mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 07:46:07 -07:00
Log recently added items to the database
* Temporarily disable recently added upgrade notifications
This commit is contained in:
parent
eac31d10f1
commit
fc7b396e45
9 changed files with 173 additions and 90 deletions
|
@ -388,12 +388,10 @@ class Libraries(object):
|
|||
pms_connect = pmsconnect.PmsConnect()
|
||||
|
||||
if rating_key:
|
||||
library_children = pms_connect.get_library_children_details(rating_key=rating_key,
|
||||
get_media_info=True)
|
||||
library_children = pms_connect.get_library_children_details(rating_key=rating_key)
|
||||
elif section_id:
|
||||
library_children = pms_connect.get_library_children_details(section_id=section_id,
|
||||
section_type=section_type,
|
||||
get_media_info=True)
|
||||
section_type=section_type)
|
||||
|
||||
if library_children:
|
||||
library_count = library_children['library_count']
|
||||
|
@ -404,8 +402,11 @@ class Libraries(object):
|
|||
|
||||
new_rows = []
|
||||
for item in children_list:
|
||||
## TODO: Check list of media info items, currently only grabs first item
|
||||
media_info = item['media_info'][0] if item['media_info'] else {}
|
||||
|
||||
cached_file_size = cached_items.get(item['rating_key'], None)
|
||||
file_size = cached_file_size if cached_file_size else item.get('file_size', '')
|
||||
file_size = cached_file_size if cached_file_size else media_info.get('file_size', '')
|
||||
|
||||
row = {'section_id': library_details['section_id'],
|
||||
'section_type': library_details['section_type'],
|
||||
|
@ -419,13 +420,13 @@ class Libraries(object):
|
|||
'media_index': item['media_index'],
|
||||
'parent_media_index': item['parent_media_index'],
|
||||
'thumb': item['thumb'],
|
||||
'container': item.get('container', ''),
|
||||
'bitrate': item.get('bitrate', ''),
|
||||
'video_codec': item.get('video_codec', ''),
|
||||
'video_resolution': item.get('video_resolution', ''),
|
||||
'video_framerate': item.get('video_framerate', ''),
|
||||
'audio_codec': item.get('audio_codec', ''),
|
||||
'audio_channels': item.get('audio_channels', ''),
|
||||
'container': media_info.get('container', ''),
|
||||
'bitrate': media_info.get('bitrate', ''),
|
||||
'video_codec': media_info.get('video_codec', ''),
|
||||
'video_resolution': media_info.get('video_resolution', ''),
|
||||
'video_framerate': media_info.get('video_framerate', ''),
|
||||
'audio_codec': media_info.get('audio_codec', ''),
|
||||
'audio_channels': media_info.get('audio_channels', ''),
|
||||
'file_size': file_size
|
||||
}
|
||||
new_rows.append(row)
|
||||
|
@ -561,11 +562,13 @@ class Libraries(object):
|
|||
file_size = 0
|
||||
|
||||
metadata = pms_connect.get_metadata_children_details(rating_key=item['rating_key'],
|
||||
get_children=True,
|
||||
get_media_info=True)
|
||||
get_children=True)
|
||||
|
||||
for child_metadata in metadata:
|
||||
file_size += helpers.cast_to_int(child_metadata.get('file_size', 0))
|
||||
## TODO: Check list of media info items, currently only grabs first item
|
||||
media_info = item['media_info'][0] if item['media_info'] else {}
|
||||
|
||||
file_size += helpers.cast_to_int(media_info.get('file_size', 0))
|
||||
|
||||
item['file_size'] = file_size
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue