Add audio_channels, resolution fields
MODIFY
plex_trakt_sync/plex_api.py
plex_trakt_sync/plex_api.py
@@ -174,6 +174,30 @@ def seen_date(self):
def collected_at(self):
return self.date_value(self.item.addedAt)
+ @property
+ @memoize
+ def audio_channels(self):
+ """
+ Set to 1.0, 2.0, 2.1, 3.0, 3.1, 4.0, 4.1, 5.0, 5.1, 5.1.2, 5.1.4, 6.1, 7.1, 7.1.2, 7.1.4, 9.1, or 10.1
+ """
+ media = self.item.media[0]
+ return media.audioChannels
+
+ @property
+ @memoize
+ def resolution(self):
+ """
+ Set to uhd_4k, hd_1080p, hd_1080i, hd_720p, sd_480p, sd_480i, sd_576p, or sd_576i.
+ """
+ map = {
+ "720": "hd_720p",
+ }
+ media = self.item.media[0]
+ try:
+ return map[media.videoResolution]
+ except KeyError:
+ return None
+
def watch_progress(self, view_offset):
percent = view_offset / self.item.duration * 100
return percent

Add audio_channels, resolution fields