Skip to content

Commit

Permalink
[chore] v2.14.0-beta compatibility (#45)
Browse files Browse the repository at this point in the history
- Add Dolby Vision info to media info
- Add before and after parameters to get_home_stats
- Add live TV metadata from EPG to response
- Drop compatibility with Tautulli v2.12 and v2.13
  • Loading branch information
nwithan8 authored Apr 19, 2024
1 parent c2d8f67 commit 67137e7
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 17 deletions.
12 changes: 1 addition & 11 deletions tautulli/API_VERSIONS.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
[
"2.12.0",
"2.12.1",
"2.12.2",
"2.12.3",
"2.12.4",
"2.12.5",
"2.13.0",
"2.13.1",
"2.13.2",
"2.13.3",
"2.13.4"
"2.14.0-beta"
]
11 changes: 9 additions & 2 deletions tautulli/api/json_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,8 @@ def get_history(self, grouping: bool = False, include_activity: bool = False, us

@raw_json
def get_home_stats(self, grouping: bool = False, time_range: int = 30, stats_type: str = 'plays', start: int = 0,
count: int = 5, stat_id: str = None, user_id: int = None, section_id: int = None) -> List[dict]:
count: int = 5, stat_id: str = None, user_id: int = None, section_id: int = None,
before: datetime = None, after: datetime = None) -> List[dict]:
"""
Get the homepage watch statistics
Expand All @@ -936,6 +937,10 @@ def get_home_stats(self, grouping: bool = False, time_range: int = 30, stats_typ
:type user_id: int, optional
:param section_id: The ID of the Plex library section
:type section_id: int, optional
:param before: Results before and including the date
:type before: datetime, optional
:param after: Results after and including the date
:type after: datetime, optional
:returns: List of data
:rtype: List[dict]
"""
Expand All @@ -946,9 +951,11 @@ def get_home_stats(self, grouping: bool = False, time_range: int = 30, stats_typ
if _is_invalid_choice(value=stat_id, variable_name='stat_id',
choices=static.stats_category):
return False, None
before = datetime_to_string(datetime_object=before)
after = datetime_to_string(datetime_object=after)
params = build_optional_params(grouping=grouping, time_range=time_range, stats_type=stats_type,
stats_start=start, stats_count=count, stat_id=stat_id, section_id=section_id,
user_id=user_id)
user_id=user_id, before=before, after=after)
return 'get_home_stats', params

@raw_json
Expand Down
12 changes: 8 additions & 4 deletions tautulli/api/object_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,8 @@ def get_history(self, grouping: bool = False, include_activity: bool = False, us

@make_object
def get_home_stats(self, grouping: bool = False, time_range: int = 30, stats_type: str = 'plays', start: int = 0,
count: int = 5, stat_id: str = None, user_id: int = None, section_id: int = None) -> List[
HomeStat]:
count: int = 5, stat_id: str = None, user_id: int = None, section_id: int = None,
before: datetime = None, after: datetime = None) -> List[HomeStat]:
"""
Get the homepage watch statistics
Expand All @@ -665,13 +665,17 @@ def get_home_stats(self, grouping: bool = False, time_range: int = 30, stats_typ
:type user_id: int, optional
:param section_id: The ID of the Plex library section
:type section_id: int, optional
:param before: Results before and including the date
:type before: datetime, optional
:param after: Results after and including the date
:type after: datetime, optional
:returns: List of HomeStat object
"""
return 'HomeStat'

@make_object
def get_item_user_stats(self, rating_key: str, grouping: bool = False, media_type: str = None) -> List[
ItemUserStat]:
def get_item_user_stats(self, rating_key: str, grouping: bool = False, media_type: str = None) \
-> List[ItemUserStat]:
"""
Get the user statistics for the media item
Expand Down
3 changes: 3 additions & 0 deletions tautulli/models/activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,11 @@ class SessionModel(BaseModel):
audio_profile: Optional[str] = None
optimized_version: Optional[int] = None
channel_call_sign: Optional[str] = None
channel_id: Optional[str] = None
channel_identifier: Optional[str] = None
channel_title: Optional[str] = None
channel_thumb: Optional[str] = None
channel_vcn: Optional[str] = None
file: Optional[str] = None
file_size: Optional[str] = None
indexes: Optional[int] = None
Expand Down
10 changes: 10 additions & 0 deletions tautulli/models/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ class StreamModel(BaseModel):
video_color_space: Optional[str] = None
video_color_trc: Optional[str] = None
video_dynamic_range: Optional[str] = None
video_dovi_bl_present: Optional[int] = None
video_dovi_el_present: Optional[int] = None
video_dovi_level: Optional[int] = None
video_dovi_present: Optional[int] = None
video_dovi_profile: Optional[int] = None
video_dovi_rpu_present: Optional[int] = None
video_dovi_version: Optional[float] = None
video_frame_rate: Optional[str] = None
video_ref_frames: Optional[str] = None
video_height: Optional[str] = None
Expand Down Expand Up @@ -69,8 +76,11 @@ class MediaInfoItemModel(BaseModel):
audio_profile: Optional[str] = None
optimized_version: Optional[int] = None
channel_call_sign: Optional[str] = None
channel_id: Optional[str] = None
channel_identifier: Optional[str] = None
channel_title: Optional[str] = None
channel_thumb: Optional[str] = None
channel_vcn: Optional[str] = None
parts: Optional[List[PartModel]] = None

class MarkerModel(BaseModel):
Expand Down

0 comments on commit 67137e7

Please sign in to comment.