Change values to int instead of "Checked" in users and libraries table

* get_users_table: allow_guest, do_notify, keep_history
* get_libraries_table: do_notify, do_notify_created, keep_history
This commit is contained in:
JonnyWong16 2022-04-12 12:43:12 -07:00
parent b0950abdd9
commit d4002b2e2b
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
5 changed files with 15 additions and 15 deletions

View file

@ -33,7 +33,7 @@ libraries_list_table_options = {
$(td).html('<div class="edit-library-toggles">' + $(td).html('<div class="edit-library-toggles">' +
'<button class="btn btn-xs btn-warning delete-library" data-id="' + rowData['row_id'] + '" data-toggle="button"><i class="fa fa-trash-o fa-fw"></i> Delete</button>&nbsp' + '<button class="btn btn-xs btn-warning delete-library" data-id="' + rowData['row_id'] + '" data-toggle="button"><i class="fa fa-trash-o fa-fw"></i> Delete</button>&nbsp' +
'<button class="btn btn-xs btn-warning purge-library" data-id="' + rowData['row_id'] + '" data-toggle="button"><i class="fa fa-eraser fa-fw"></i> Purge</button>&nbsp&nbsp&nbsp' + '<button class="btn btn-xs btn-warning purge-library" data-id="' + rowData['row_id'] + '" data-toggle="button"><i class="fa fa-eraser fa-fw"></i> Purge</button>&nbsp&nbsp&nbsp' +
'<input type="checkbox" id="keep_history-' + rowData['section_id'] + '" name="keep_history" value="1" ' + rowData['keep_history'] + '><label class="edit-tooltip" for="keep_history-' + rowData['section_id'] + '" data-toggle="tooltip" title="Toggle History"><i class="fa fa-history fa-lg fa-fw"></i></label>&nbsp' + '<input type="checkbox" id="keep_history-' + rowData['section_id'] + '" name="keep_history" value="1" ' + (rowData['keep_history'] ? 'checked' : '') + '><label class="edit-tooltip" for="keep_history-' + rowData['section_id'] + '" data-toggle="tooltip" title="Toggle History"><i class="fa fa-history fa-lg fa-fw"></i></label>&nbsp' +
'</div>'); '</div>');
}, },
"width": "7%", "width": "7%",

View file

@ -50,8 +50,8 @@ users_list_table_options = {
$(td).html('<div class="edit-user-toggles">' + $(td).html('<div class="edit-user-toggles">' +
'<button class="btn btn-xs btn-warning delete-user" data-id="' + rowData['row_id'] + '" data-toggle="button"><i class="fa fa-trash-o fa-fw"></i> Delete</button>&nbsp' + '<button class="btn btn-xs btn-warning delete-user" data-id="' + rowData['row_id'] + '" data-toggle="button"><i class="fa fa-trash-o fa-fw"></i> Delete</button>&nbsp' +
'<button class="btn btn-xs btn-warning purge-user" data-id="' + rowData['row_id'] + '" data-toggle="button"><i class="fa fa-eraser fa-fw"></i> Purge</button>&nbsp&nbsp&nbsp' + '<button class="btn btn-xs btn-warning purge-user" data-id="' + rowData['row_id'] + '" data-toggle="button"><i class="fa fa-eraser fa-fw"></i> Purge</button>&nbsp&nbsp&nbsp' +
'<input type="checkbox" id="keep_history-' + rowData['user_id'] + '" name="keep_history" value="1" ' + rowData['keep_history'] + '><label class="edit-tooltip" for="keep_history-' + rowData['user_id'] + '" data-toggle="tooltip" title="Toggle History"><i class="fa fa-history fa-lg fa-fw"></i></label>&nbsp' + '<input type="checkbox" id="keep_history-' + rowData['user_id'] + '" name="keep_history" value="1" ' + (rowData['keep_history'] ? 'checked' : '') + '><label class="edit-tooltip" for="keep_history-' + rowData['user_id'] + '" data-toggle="tooltip" title="Toggle History"><i class="fa fa-history fa-lg fa-fw"></i></label>&nbsp' +
'<input type="checkbox" id="allow_guest-' + rowData['user_id'] + '" name="allow_guest" value="1" ' + rowData['allow_guest'] + '><label class="edit-tooltip" for="allow_guest-' + rowData['user_id'] + '" data-toggle="tooltip" title="Toggle Guest Access"><i class="fa fa-unlock-alt fa-lg fa-fw"></i></label>&nbsp' + '<input type="checkbox" id="allow_guest-' + rowData['user_id'] + '" name="allow_guest" value="1" ' + (rowData['allow_guest'] ? 'checked' : '') + '><label class="edit-tooltip" for="allow_guest-' + rowData['user_id'] + '" data-toggle="tooltip" title="Toggle Guest Access"><i class="fa fa-unlock-alt fa-lg fa-fw"></i></label>&nbsp' +
'</div>'); '</div>');
}, },
"width": "7%", "width": "7%",

View file

@ -432,9 +432,9 @@ class Libraries(object):
'live': item['live'], 'live': item['live'],
'originally_available_at': item['originally_available_at'], 'originally_available_at': item['originally_available_at'],
'guid': item['guid'], 'guid': item['guid'],
'do_notify': helpers.checked(item['do_notify']), 'do_notify': item['do_notify'],
'do_notify_created': helpers.checked(item['do_notify_created']), 'do_notify_created': item['do_notify_created'],
'keep_history': helpers.checked(item['keep_history']), 'keep_history': item['keep_history'],
'is_active': item['is_active'] 'is_active': item['is_active']
} }

View file

@ -234,9 +234,9 @@ class Users(object):
'originally_available_at': item['originally_available_at'], 'originally_available_at': item['originally_available_at'],
'guid': item['guid'], 'guid': item['guid'],
'transcode_decision': item['transcode_decision'], 'transcode_decision': item['transcode_decision'],
'do_notify': helpers.checked(item['do_notify']), 'do_notify': item['do_notify'],
'keep_history': helpers.checked(item['keep_history']), 'keep_history': item['keep_history'],
'allow_guest': helpers.checked(item['allow_guest']), 'allow_guest': item['allow_guest'],
'is_active': item['is_active'] 'is_active': item['is_active']
} }

View file

@ -495,13 +495,13 @@ class WebInterface(object):
[{"child_count": 3745, [{"child_count": 3745,
"content_rating": "TV-MA", "content_rating": "TV-MA",
"count": 62, "count": 62,
"do_notify": "Checked", "do_notify": 1,
"do_notify_created": "Checked", "do_notify_created": 1,
"duration": 1578037, "duration": 1578037,
"guid": "com.plexapp.agents.thetvdb://121361/6/1?lang=en", "guid": "com.plexapp.agents.thetvdb://121361/6/1?lang=en",
"histroy_row_id": 1128, "histroy_row_id": 1128,
"is_active": 1, "is_active": 1,
"keep_history": "Checked", "keep_history": 1,
"labels": [], "labels": [],
"last_accessed": 1462693216, "last_accessed": 1462693216,
"last_played": "Game of Thrones - The Red Woman", "last_played": "Game of Thrones - The Red Woman",
@ -1264,8 +1264,8 @@ class WebInterface(object):
"recordsTotal": 10, "recordsTotal": 10,
"recordsFiltered": 10, "recordsFiltered": 10,
"data": "data":
[{"allow_guest": "Checked", [{"allow_guest": 1,
"do_notify": "Checked", "do_notify": 1,
"duration": 2998290, "duration": 2998290,
"friendly_name": "Jon Snow", "friendly_name": "Jon Snow",
"username": "LordCommanderSnow", "username": "LordCommanderSnow",
@ -1275,7 +1275,7 @@ class WebInterface(object):
"history_row_id": 1121, "history_row_id": 1121,
"ip_address": "xxx.xxx.xxx.xxx", "ip_address": "xxx.xxx.xxx.xxx",
"is_active": 1, "is_active": 1,
"keep_history": "Checked", "keep_history": 1,
"last_played": "Game of Thrones - The Red Woman", "last_played": "Game of Thrones - The Red Woman",
"last_seen": 1462591869, "last_seen": 1462591869,
"live": 0, "live": 0,