local scanner artwork cleanup (#2778)

* move plex artwork removal to its own repository

* clean up old local movie artwork

* clien up old music video/artist artwork

* clean up old remote stream artwork

* clean up old song artwork

* clean up old show artwork; properly update season artwork
This commit is contained in:
Jason Dove
2026-01-16 10:23:26 -06:00
committed by GitHub
parent 36f44f14bb
commit a2d023ee69
22 changed files with 284 additions and 168 deletions
@@ -25,25 +25,27 @@ public class RemoteStreamRepository(
Option<RemoteStream> maybeExisting = await dbContext.RemoteStreams
.AsNoTracking()
.Include(i => i.RemoteStreamMetadata)
.ThenInclude(ovm => ovm.Genres)
.ThenInclude(rsm => rsm.Genres)
.Include(i => i.RemoteStreamMetadata)
.ThenInclude(ovm => ovm.Tags)
.ThenInclude(rsm => rsm.Tags)
.Include(i => i.RemoteStreamMetadata)
.ThenInclude(ovm => ovm.Studios)
.ThenInclude(rsm => rsm.Studios)
.Include(i => i.RemoteStreamMetadata)
.ThenInclude(ovm => ovm.Guids)
.ThenInclude(rsm => rsm.Guids)
.Include(i => i.RemoteStreamMetadata)
.ThenInclude(ovm => ovm.Actors)
.ThenInclude(rsm => rsm.Actors)
.Include(i => i.RemoteStreamMetadata)
.ThenInclude(ovm => ovm.Actors)
.ThenInclude(rsm => rsm.Actors)
.ThenInclude(a => a.Artwork)
.Include(ov => ov.LibraryPath)
.Include(i => i.RemoteStreamMetadata)
.ThenInclude(rsm => rsm.Artwork)
.Include(rs => rs.LibraryPath)
.ThenInclude(lp => lp.Library)
.Include(ov => ov.MediaVersions)
.ThenInclude(ov => ov.MediaFiles)
.Include(ov => ov.MediaVersions)
.ThenInclude(ov => ov.Streams)
.Include(ov => ov.TraktListItems)
.Include(rs => rs.MediaVersions)
.ThenInclude(mv => mv.MediaFiles)
.Include(rs => rs.MediaVersions)
.ThenInclude(mv => mv.Streams)
.Include(rs => rs.TraktListItems)
.ThenInclude(tli => tli.TraktList)
.OrderBy(i => i.MediaVersions.First().MediaFiles.First().Path)
.SingleOrDefaultAsync(i => i.MediaVersions.First().MediaFiles.First().Path == path, cancellationToken);