mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 13:41:15 -07:00
Save metadata and media info export level to database
This commit is contained in:
parent
3973c57020
commit
4e29960238
5 changed files with 43 additions and 10 deletions
|
@ -573,6 +573,8 @@ DOCUMENTATION :: END
|
|||
<th align="left" id="rating_key">Rating Key</th>
|
||||
<th align="left" id="filename">Filename</th>
|
||||
<th align="left" id="file_format">File Format</th>
|
||||
<th align="left" id="metadata_level">Metadata Level</th>
|
||||
<th align="left" id="media_info_level">Media Info Level</th>
|
||||
<th align="left" id="file_size">File Size</th>
|
||||
<th align="left" id="complete">Download</th>
|
||||
<th align="left" id="delete">Delete</th>
|
||||
|
|
|
@ -39,7 +39,7 @@ export_table_options = {
|
|||
$(td).html(moment(cellData, "X").format(date_format + ' ' + time_format));
|
||||
}
|
||||
},
|
||||
"width": "10%",
|
||||
"width": "8%",
|
||||
"className": "no-wrap"
|
||||
},
|
||||
{
|
||||
|
@ -76,7 +76,7 @@ export_table_options = {
|
|||
}
|
||||
}
|
||||
},
|
||||
"width": "50%",
|
||||
"width": "40%",
|
||||
"className": "no-wrap"
|
||||
},
|
||||
{
|
||||
|
@ -96,6 +96,28 @@ export_table_options = {
|
|||
},
|
||||
{
|
||||
"targets": [5],
|
||||
"data": "metadata_level",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== null) {
|
||||
$(td).html(cellData);
|
||||
}
|
||||
},
|
||||
"width": "6%",
|
||||
"className": "no-wrap"
|
||||
},
|
||||
{
|
||||
"targets": [6],
|
||||
"data": "media_info_level",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== null) {
|
||||
$(td).html(cellData);
|
||||
}
|
||||
},
|
||||
"width": "6%",
|
||||
"className": "no-wrap"
|
||||
},
|
||||
{
|
||||
"targets": [7],
|
||||
"data": "file_size",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData !== '' && cellData !== null) {
|
||||
|
@ -106,7 +128,7 @@ export_table_options = {
|
|||
"className": "no-wrap"
|
||||
},
|
||||
{
|
||||
"targets": [6],
|
||||
"targets": [8],
|
||||
"data": "complete",
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (cellData === 1 && rowData['exists']) {
|
||||
|
@ -123,7 +145,7 @@ export_table_options = {
|
|||
"className": "export_download"
|
||||
},
|
||||
{
|
||||
"targets": [7],
|
||||
"targets": [9],
|
||||
"data": null,
|
||||
"createdCell": function (td, cellData, rowData, row, col) {
|
||||
if (rowData['complete'] !== 0) {
|
||||
|
|
|
@ -344,6 +344,8 @@ DOCUMENTATION :: END
|
|||
<th align="left" id="rating_key">Rating Key</th>
|
||||
<th align="left" id="filename">Filename</th>
|
||||
<th align="left" id="file_format">File Format</th>
|
||||
<th align="left" id="metadata_level">Metadata Level</th>
|
||||
<th align="left" id="media_info_level">Media Info Level</th>
|
||||
<th align="left" id="file_size">File Size</th>
|
||||
<th align="left" id="complete">Download</th>
|
||||
<th align="left" id="delete">Delete</th>
|
||||
|
|
|
@ -797,7 +797,9 @@ def dbcheck():
|
|||
c_db.execute(
|
||||
'CREATE TABLE IF NOT EXISTS exports (id INTEGER PRIMARY KEY AUTOINCREMENT, '
|
||||
'timestamp INTEGER, section_id INTEGER, rating_key INTEGER, media_type TEXT, '
|
||||
'filename TEXT, file_format TEXT, include_images INTEGER DEFAULT 0, '
|
||||
'filename TEXT, file_format TEXT, '
|
||||
'metadata_level INTEGER, media_info_level INTEGER, include_images INTEGER DEFAULT 0, '
|
||||
'custom_fields TEXT, '
|
||||
'file_size INTEGER DEFAULT 0, complete INTEGER DEFAULT 0)'
|
||||
)
|
||||
|
||||
|
|
|
@ -86,7 +86,6 @@ class Export(object):
|
|||
self.timestamp = helpers.timestamp()
|
||||
|
||||
self.media_type = None
|
||||
self.sub_media_type = None
|
||||
self.items = []
|
||||
|
||||
self.filename = None
|
||||
|
@ -1421,9 +1420,6 @@ class Export(object):
|
|||
item = plex.get_item(self.rating_key)
|
||||
self.media_type = item.type
|
||||
|
||||
if self.media_type == 'collection':
|
||||
self.sub_media_type = item.subtype
|
||||
|
||||
if self.media_type != 'playlist':
|
||||
self.section_id = item.librarySectionID
|
||||
|
||||
|
@ -1511,7 +1507,10 @@ class Export(object):
|
|||
|
||||
values = {'file_format': self.file_format,
|
||||
'filename': self.filename,
|
||||
'include_images': self.include_images}
|
||||
'metadata_level': self.metadata_level,
|
||||
'media_info_level': self.media_info_level,
|
||||
'include_images': self.include_images,
|
||||
'custom_fields': self.custom_fields}
|
||||
|
||||
db = database.MonitorDatabase()
|
||||
try:
|
||||
|
@ -1760,7 +1759,10 @@ def get_export_datatable(section_id=None, rating_key=None, kwargs=None):
|
|||
'exports.media_type',
|
||||
'exports.filename',
|
||||
'exports.file_format',
|
||||
'exports.metadata_level',
|
||||
'exports.media_info_level',
|
||||
'exports.include_images',
|
||||
'exports.custom_fields',
|
||||
'exports.file_size',
|
||||
'exports.complete'
|
||||
]
|
||||
|
@ -1792,7 +1794,10 @@ def get_export_datatable(section_id=None, rating_key=None, kwargs=None):
|
|||
'media_type_title': media_type_title,
|
||||
'filename': item['filename'],
|
||||
'file_format': item['file_format'],
|
||||
'metadata_level': item['metadata_level'],
|
||||
'media_info_level': item['media_info_level'],
|
||||
'include_images': item['include_images'],
|
||||
'custom_fields': item['custom_fields'],
|
||||
'file_size': item['file_size'],
|
||||
'complete': item['complete'],
|
||||
'exists': exists
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue