Browse Source

improve plex item change detection (#1659)

pull/1660/head
Jason Dove 1 year ago committed by GitHub
parent
commit
14a707a4e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      CHANGELOG.md
  2. 4
      ErsatzTV.Infrastructure/Plex/Models/PlexPartResponse.cs
  3. 12
      ErsatzTV.Infrastructure/Plex/Models/PlexXmlPartResponse.cs
  4. 38
      ErsatzTV.Infrastructure/Plex/PlexEtag.cs

3
CHANGELOG.md

@ -52,6 +52,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -52,6 +52,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix path replacement logic when media server paths use inconsistent casing (e.g. `\\SERVERNAME` AND `\\ServerName`)
- Fix *many* search queries, including actors with the name `Will`
- Fix sqlite `database is locked` error that would crash ETV on startup after search index corruption
- Fix bug where replacing files in Plex would be missed by subsequent ETV library scans
- This fix will require a one-time re-scan of each Plex library in full
- After the initial full scan, incremental scans will behave as normal
### Changed
- Log search index updates under scanner category at debug level, to indicate a potential cause for the UI being out of date

4
ErsatzTV.Infrastructure/Plex/Models/PlexPartResponse.cs

@ -6,4 +6,8 @@ public class PlexPartResponse @@ -6,4 +6,8 @@ public class PlexPartResponse
public string Key { get; set; }
public int Duration { get; set; }
public string File { get; set; }
public long Size { get; set; }
public string Container { get; set; }
public string VideoProfile { get; set; }
public string AudioProfile { get; set; }
}

12
ErsatzTV.Infrastructure/Plex/Models/PlexXmlPartResponse.cs

@ -16,6 +16,18 @@ public class PlexXmlPartResponse @@ -16,6 +16,18 @@ public class PlexXmlPartResponse
[XmlAttribute("file")]
public string File { get; set; }
[XmlAttribute("size")]
public long Size { get; set; }
[XmlAttribute("container")]
public string Container { get; set; }
[XmlAttribute("videoProfile")]
public string VideoProfile { get; set; }
[XmlAttribute("audioProfile")]
public string AudioProfile { get; set; }
[XmlElement("Stream")]
public List<PlexStreamResponse> Stream { get; set; }
}

38
ErsatzTV.Infrastructure/Plex/PlexEtag.cs

@ -41,6 +41,21 @@ public class PlexEtag @@ -41,6 +41,21 @@ public class PlexEtag
bw.Write((byte)FieldKey.File);
bw.Write(part.File);
bw.Write((byte)FieldKey.Duration);
bw.Write(part.Duration);
bw.Write((byte)FieldKey.Size);
bw.Write(part.Size);
bw.Write((byte)FieldKey.Container);
bw.Write(part.Container ?? string.Empty);
bw.Write((byte)FieldKey.VideoProfile);
bw.Write(part.VideoProfile ?? string.Empty);
bw.Write((byte)FieldKey.AudioProfile);
bw.Write(part.AudioProfile ?? string.Empty);
}
}
@ -205,6 +220,21 @@ public class PlexEtag @@ -205,6 +220,21 @@ public class PlexEtag
bw.Write((byte)FieldKey.File);
bw.Write(part.File);
bw.Write((byte)FieldKey.Duration);
bw.Write(part.Duration);
bw.Write((byte)FieldKey.Size);
bw.Write(part.Size);
bw.Write((byte)FieldKey.Container);
bw.Write(part.Container ?? string.Empty);
bw.Write((byte)FieldKey.VideoProfile);
bw.Write(part.VideoProfile ?? string.Empty);
bw.Write((byte)FieldKey.AudioProfile);
bw.Write(part.AudioProfile ?? string.Empty);
// stream id
foreach (PlexStreamResponse stream in part.Stream)
{
@ -298,6 +328,12 @@ public class PlexEtag @@ -298,6 +328,12 @@ public class PlexEtag
File = 30,
ChildCount = 40,
Smart = 41 // smart collection bool
Smart = 41, // smart collection bool
Duration = 50,
Size = 51,
Container = 52,
VideoProfile = 53,
AudioProfile = 54
}
}

Loading…
Cancel
Save