Browse Source

fix updating jellyfin movies (#1587)

pull/1588/head
Jason Dove 2 years ago committed by GitHub
parent
commit
e0aa44d41b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      CHANGELOG.md
  2. 19
      ErsatzTV.Application/MediaItems/Queries/GetMediaItemInfoHandler.cs
  3. 2
      ErsatzTV.Infrastructure/Data/Repositories/JellyfinMovieRepository.cs

4
CHANGELOG.md

@ -9,7 +9,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -9,7 +9,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed
- Fix antiforgery error caused by reusing existing browser tabs across docker container restarts
- Data protection keys will now be persisted under ErsatzTV's config folder instead of being recreated at startup
- Data protection keys will now be persisted under ErsatzTV's config folder instead of being recreated at startup
- Fix bug updating/replacing Jellyfin movies
- A deep scan can be used to fix all movies, otherwise any future updates made to JF movies will correctly sync to ETV
### Changed
- Pass through `access_token` query param from `Channels` page url to streaming endpoints

19
ErsatzTV.Application/MediaItems/Queries/GetMediaItemInfoHandler.cs

@ -63,17 +63,20 @@ public class GetMediaItemInfoHandler : IRequestHandler<GetMediaItemInfo, Either< @@ -63,17 +63,20 @@ public class GetMediaItemInfoHandler : IRequestHandler<GetMediaItemInfo, Either<
_ => null
};
List<Subtitle> subtitles = mediaItem switch
{
Movie m => m.MovieMetadata.Map(mm => mm.Subtitles).Flatten().ToList(),
Episode e => e.EpisodeMetadata.Map(mm => mm.Subtitles).Flatten().ToList(),
_ => new List<Subtitle>()
};
var allStreams = version.Streams.OrderBy(s => s.Index).Map(Project).ToList();
// include external subtitles from local libraries
allStreams.AddRange(subtitles.Filter(s => s.SubtitleKind is SubtitleKind.Sidecar).Map(ProjectToStream));
if (mediaItem.LibraryPath.Library is LocalLibrary)
{
List<Subtitle> subtitles = mediaItem switch
{
Movie m => m.MovieMetadata.Map(mm => mm.Subtitles).Flatten().ToList(),
Episode e => e.EpisodeMetadata.Map(mm => mm.Subtitles).Flatten().ToList(),
_ => new List<Subtitle>()
};
allStreams.AddRange(subtitles.Filter(s => s.SubtitleKind is SubtitleKind.Sidecar).Map(ProjectToStream));
}
var allChapters = (version.Chapters ?? []).OrderBy(c => c.StartTime).Map(Project).ToList();

2
ErsatzTV.Infrastructure/Data/Repositories/JellyfinMovieRepository.cs

@ -195,8 +195,6 @@ public class JellyfinMovieRepository : IJellyfinMovieRepository @@ -195,8 +195,6 @@ public class JellyfinMovieRepository : IJellyfinMovieRepository
incoming.LibraryPath = existing.LibraryPath;
incoming.Id = existing.Id;
existing.Etag = incoming.Etag;
// metadata
MovieMetadata metadata = existing.MovieMetadata.Head();
MovieMetadata incomingMetadata = incoming.MovieMetadata.Head();

Loading…
Cancel
Save