mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-11 05:33:37 +00:00
Added back tvrage_name and tvrage_id to mirror show_name and indexer_id so that other apps that need those values have them available.
Cleaned up video html in display shows.
This commit is contained in:
parent
13f12b2635
commit
84fe4f0aeb
3 changed files with 72 additions and 63 deletions
|
@ -328,6 +328,8 @@
|
||||||
#set $video_root = $os.path.dirname($show._location)
|
#set $video_root = $os.path.dirname($show._location)
|
||||||
#set $video_source = $sbRoot + $epResult["location"].replace($video_root, '/videos')
|
#set $video_source = $sbRoot + $epResult["location"].replace($video_root, '/videos')
|
||||||
<div id="$video_source" class="jwvideo">Loading the player...</div>
|
<div id="$video_source" class="jwvideo">Loading the player...</div>
|
||||||
|
#else:
|
||||||
|
No Video
|
||||||
#end if
|
#end if
|
||||||
</td>
|
</td>
|
||||||
#end if
|
#end if
|
||||||
|
|
|
@ -25,7 +25,7 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#changeStatus').click(function () {
|
$('#changeStatus').click(function () {
|
||||||
var sbRoot = $('#sbRoot').val()
|
var sbRoot = $('#sbRoot').val();
|
||||||
var epArr = new Array()
|
var epArr = new Array()
|
||||||
|
|
||||||
$('.epCheck').each(function () {
|
$('.epCheck').each(function () {
|
||||||
|
@ -37,9 +37,9 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (epArr.length == 0)
|
if (epArr.length == 0)
|
||||||
return false
|
return false;
|
||||||
|
|
||||||
url = sbRoot + '/home/setStatus?show=' + $('#showID').attr('value') + '&eps=' + epArr.join('|') + '&status=' + $('#statusSelect').attr('value')
|
url = sbRoot + '/home/setStatus?show=' + $('#showID').attr('value') + '&eps=' + epArr.join('|') + '&status=' + $('#statusSelect').attr('value');
|
||||||
window.location.href = url
|
window.location.href = url
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -49,7 +49,7 @@ $(document).ready(function () {
|
||||||
var seasNo = $(seasCheck).attr('id');
|
var seasNo = $(seasCheck).attr('id');
|
||||||
|
|
||||||
$('.epCheck:visible').each(function () {
|
$('.epCheck:visible').each(function () {
|
||||||
var epParts = $(this).attr('id').split('x')
|
var epParts = $(this).attr('id').split('x');
|
||||||
|
|
||||||
if (epParts[0] == seasNo) {
|
if (epParts[0] == seasNo) {
|
||||||
this.checked = seasCheck.checked
|
this.checked = seasCheck.checked
|
||||||
|
@ -105,18 +105,18 @@ $(document).ready(function () {
|
||||||
|
|
||||||
// handle the show selection dropbox
|
// handle the show selection dropbox
|
||||||
$('#pickShow').change(function () {
|
$('#pickShow').change(function () {
|
||||||
var sbRoot = $('#sbRoot').val()
|
var sbRoot = $('#sbRoot').val();
|
||||||
var val = $(this).attr('value')
|
var val = $(this).attr('value');
|
||||||
if (val == 0)
|
if (val == 0)
|
||||||
return
|
return;
|
||||||
url = sbRoot + '/home/displayShow?show=' + val
|
url = sbRoot + '/home/displayShow?show=' + val;
|
||||||
window.location.href = url
|
window.location.href = url
|
||||||
});
|
});
|
||||||
|
|
||||||
// show/hide different types of rows when the checkboxes are changed
|
// show/hide different types of rows when the checkboxes are changed
|
||||||
$("#checkboxControls input").change(function (e) {
|
$("#checkboxControls input").change(function (e) {
|
||||||
var whichClass = $(this).attr('id')
|
var whichClass = $(this).attr('id');
|
||||||
$(this).showHideRows(whichClass)
|
$(this).showHideRows(whichClass);
|
||||||
|
|
||||||
$('tr.' + whichClass).each(function (i) {
|
$('tr.' + whichClass).each(function (i) {
|
||||||
$(this).toggle();
|
$(this).toggle();
|
||||||
|
@ -137,7 +137,7 @@ $(document).ready(function () {
|
||||||
|
|
||||||
$.fn.showHideRows = function (whichClass) {
|
$.fn.showHideRows = function (whichClass) {
|
||||||
|
|
||||||
var status = $('#checkboxControls > input, #' + whichClass).prop('checked')
|
var status = $('#checkboxControls > input, #' + whichClass).prop('checked');
|
||||||
$("tr." + whichClass).each(function (e) {
|
$("tr." + whichClass).each(function (e) {
|
||||||
if (status) {
|
if (status) {
|
||||||
$(this).show();
|
$(this).show();
|
||||||
|
@ -148,21 +148,21 @@ $(document).ready(function () {
|
||||||
|
|
||||||
// hide season headers with no episodes under them
|
// hide season headers with no episodes under them
|
||||||
$('tr.seasonheader').each(function () {
|
$('tr.seasonheader').each(function () {
|
||||||
var numRows = 0
|
var numRows = 0;
|
||||||
var seasonNo = $(this).attr('id')
|
var seasonNo = $(this).attr('id');
|
||||||
$('tr.' + seasonNo + ' :visible').each(function () {
|
$('tr.' + seasonNo + ' :visible').each(function () {
|
||||||
numRows++
|
numRows++
|
||||||
})
|
});
|
||||||
if (numRows == 0) {
|
if (numRows == 0) {
|
||||||
$(this).hide()
|
$(this).hide();
|
||||||
$('#' + seasonNo + '-cols').hide()
|
$('#' + seasonNo + '-cols').hide()
|
||||||
} else {
|
} else {
|
||||||
$(this).show()
|
$(this).show();
|
||||||
$('#' + seasonNo + '-cols').show()
|
$('#' + seasonNo + '-cols').show()
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
function setEpisodeSceneNumbering(forSeason, forEpisode, sceneSeason, sceneEpisode) {
|
function setEpisodeSceneNumbering(forSeason, forEpisode, sceneSeason, sceneEpisode) {
|
||||||
var sbRoot = $('#sbRoot').val();
|
var sbRoot = $('#sbRoot').val();
|
||||||
|
|
|
@ -98,7 +98,8 @@ class Api(webserve.MainHandler):
|
||||||
|
|
||||||
# if debug was set call the "_call_dispatcher"
|
# if debug was set call the "_call_dispatcher"
|
||||||
if 'debug' in kwargs:
|
if 'debug' in kwargs:
|
||||||
outDict = _call_dispatcher(self, args, kwargs) # this way we can debug the cherry.py traceback in the browser
|
outDict = _call_dispatcher(self, args,
|
||||||
|
kwargs) # this way we can debug the cherry.py traceback in the browser
|
||||||
del kwargs["debug"]
|
del kwargs["debug"]
|
||||||
else: # if debug was not set we wrap the "call_dispatcher" in a try block to assure a json output
|
else: # if debug was not set we wrap the "call_dispatcher" in a try block to assure a json output
|
||||||
try:
|
try:
|
||||||
|
@ -204,7 +205,7 @@ def call_dispatcher(handler, args, kwargs):
|
||||||
"""
|
"""
|
||||||
logger.log(u"API :: all args: '" + str(args) + "'", logger.DEBUG)
|
logger.log(u"API :: all args: '" + str(args) + "'", logger.DEBUG)
|
||||||
logger.log(u"API :: all kwargs: '" + str(kwargs) + "'", logger.DEBUG)
|
logger.log(u"API :: all kwargs: '" + str(kwargs) + "'", logger.DEBUG)
|
||||||
#logger.log(u"API :: dateFormat: '" + str(dateFormat) + "'", logger.DEBUG)
|
# logger.log(u"API :: dateFormat: '" + str(dateFormat) + "'", logger.DEBUG)
|
||||||
|
|
||||||
cmds = None
|
cmds = None
|
||||||
if args:
|
if args:
|
||||||
|
@ -502,9 +503,9 @@ class TVDBShorthandWrapper(ApiCall):
|
||||||
return CMD_Show(self.handler, args, self.kwargs).run()
|
return CMD_Show(self.handler, args, self.kwargs).run()
|
||||||
|
|
||||||
|
|
||||||
################################
|
# ###############################
|
||||||
# helper functions #
|
# helper functions #
|
||||||
################################
|
# ###############################
|
||||||
|
|
||||||
def _sizeof_fmt(num):
|
def _sizeof_fmt(num):
|
||||||
for x in ['bytes', 'KB', 'MB', 'GB', 'TB']:
|
for x in ['bytes', 'KB', 'MB', 'GB', 'TB']:
|
||||||
|
@ -675,7 +676,7 @@ class IntParseError(Exception):
|
||||||
"A value could not be parsed into a int. But should be parsable to a int "
|
"A value could not be parsed into a int. But should be parsable to a int "
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------------#
|
# -------------------------------------------------------------------------------------#
|
||||||
|
|
||||||
|
|
||||||
class CMD_Help(ApiCall):
|
class CMD_Help(ApiCall):
|
||||||
|
@ -1008,7 +1009,6 @@ class CMD_EpisodeSetStatus(ApiCall):
|
||||||
myDB = db.DBConnection()
|
myDB = db.DBConnection()
|
||||||
myDB.mass_action(sql_l)
|
myDB.mass_action(sql_l)
|
||||||
|
|
||||||
|
|
||||||
extra_msg = ""
|
extra_msg = ""
|
||||||
if start_backlog:
|
if start_backlog:
|
||||||
cur_backlog_queue_item = search_queue.BacklogQueueItem(showObj, ep_segment)
|
cur_backlog_queue_item = search_queue.BacklogQueueItem(showObj, ep_segment)
|
||||||
|
@ -1211,7 +1211,6 @@ class CMD_HistoryTrim(ApiCall):
|
||||||
myDB.action("DELETE FROM history WHERE date < " + str(
|
myDB.action("DELETE FROM history WHERE date < " + str(
|
||||||
(datetime.datetime.today() - datetime.timedelta(days=30)).strftime(history.dateFormat)))
|
(datetime.datetime.today() - datetime.timedelta(days=30)).strftime(history.dateFormat)))
|
||||||
|
|
||||||
|
|
||||||
return _responds(RESULT_SUCCESS, msg="Removed history entries greater than 30 days old")
|
return _responds(RESULT_SUCCESS, msg="Removed history entries greater than 30 days old")
|
||||||
|
|
||||||
|
|
||||||
|
@ -1368,7 +1367,6 @@ class CMD_SickBeardCheckScheduler(ApiCall):
|
||||||
backlogRunning = sickbeard.searchQueueScheduler.action.is_backlog_in_progress() #@UndefinedVariable
|
backlogRunning = sickbeard.searchQueueScheduler.action.is_backlog_in_progress() #@UndefinedVariable
|
||||||
nextBacklog = sickbeard.backlogSearchScheduler.nextRun().strftime(dateFormat).decode(sickbeard.SYS_ENCODING)
|
nextBacklog = sickbeard.backlogSearchScheduler.nextRun().strftime(dateFormat).decode(sickbeard.SYS_ENCODING)
|
||||||
|
|
||||||
|
|
||||||
data = {"backlog_is_paused": int(backlogPaused), "backlog_is_running": int(backlogRunning),
|
data = {"backlog_is_paused": int(backlogPaused), "backlog_is_running": int(backlogRunning),
|
||||||
"last_backlog": _ordinal_to_dateForm(sqlResults[0]["last_backlog"]),
|
"last_backlog": _ordinal_to_dateForm(sqlResults[0]["last_backlog"]),
|
||||||
"next_backlog": nextBacklog}
|
"next_backlog": nextBacklog}
|
||||||
|
@ -1750,10 +1748,13 @@ class CMD_Show(ApiCall):
|
||||||
showDict["show_name"] = showObj.name
|
showDict["show_name"] = showObj.name
|
||||||
showDict["paused"] = showObj.paused
|
showDict["paused"] = showObj.paused
|
||||||
showDict["air_by_date"] = showObj.air_by_date
|
showDict["air_by_date"] = showObj.air_by_date
|
||||||
showDict["sports"] = showObj.sports
|
|
||||||
showDict["flatten_folders"] = showObj.flatten_folders
|
showDict["flatten_folders"] = showObj.flatten_folders
|
||||||
|
showDict["sports"] = showObj.sports
|
||||||
|
showDict["anime"] = showObj.anime
|
||||||
#clean up tvdb horrible airs field
|
#clean up tvdb horrible airs field
|
||||||
showDict["airs"] = str(showObj.airs).replace('am', ' AM').replace('pm', ' PM').replace(' ', ' ')
|
showDict["airs"] = str(showObj.airs).replace('am', ' AM').replace('pm', ' PM').replace(' ', ' ')
|
||||||
|
showDict["tvrage_id"] = showObj.indexerid
|
||||||
|
showDict["tvrage_name"] = showObj.name
|
||||||
showDict["network"] = showObj.network
|
showDict["network"] = showObj.network
|
||||||
if not showDict["network"]:
|
if not showDict["network"]:
|
||||||
showDict["network"] = ""
|
showDict["network"] = ""
|
||||||
|
@ -1820,7 +1821,8 @@ class CMD_ShowAddExisting(ApiCall):
|
||||||
return _responds(RESULT_FAILURE, msg='Not a valid location')
|
return _responds(RESULT_FAILURE, msg='Not a valid location')
|
||||||
|
|
||||||
indexerName = None
|
indexerName = None
|
||||||
indexerResult = CMD_SickBeardSearchIndexers(self.handler, [], {"indexerid": self.indexerid, "indexer": self.indexer}).run()
|
indexerResult = CMD_SickBeardSearchIndexers(self.handler, [],
|
||||||
|
{"indexerid": self.indexerid, "indexer": self.indexer}).run()
|
||||||
|
|
||||||
if indexerResult['result'] == result_type_map[RESULT_SUCCESS]:
|
if indexerResult['result'] == result_type_map[RESULT_SUCCESS]:
|
||||||
if not indexerResult['data']['results']:
|
if not indexerResult['data']['results']:
|
||||||
|
@ -1982,7 +1984,8 @@ class CMD_ShowAddNew(ApiCall):
|
||||||
newStatus = self.status
|
newStatus = self.status
|
||||||
|
|
||||||
indexerName = None
|
indexerName = None
|
||||||
indexerResult = CMD_SickBeardSearchIndexers(self.handler, [], {"indexerid": self.indexerid, "indexer": self.indexer}).run()
|
indexerResult = CMD_SickBeardSearchIndexers(self.handler, [],
|
||||||
|
{"indexerid": self.indexerid, "indexer": self.indexer}).run()
|
||||||
|
|
||||||
if indexerResult['result'] == result_type_map[RESULT_SUCCESS]:
|
if indexerResult['result'] == result_type_map[RESULT_SUCCESS]:
|
||||||
if not indexerResult['data']['results']:
|
if not indexerResult['data']['results']:
|
||||||
|
@ -2008,7 +2011,8 @@ class CMD_ShowAddNew(ApiCall):
|
||||||
else:
|
else:
|
||||||
helpers.chmodAsParent(showPath)
|
helpers.chmodAsParent(showPath)
|
||||||
|
|
||||||
sickbeard.showQueueScheduler.action.addShow(int(self.indexer), int(self.indexerid), showPath, newStatus, newQuality,
|
sickbeard.showQueueScheduler.action.addShow(int(self.indexer), int(self.indexerid), showPath, newStatus,
|
||||||
|
newQuality,
|
||||||
int(self.flatten_folders), self.lang, self.subtitles, self.anime,
|
int(self.flatten_folders), self.lang, self.subtitles, self.anime,
|
||||||
self.scene) # @UndefinedVariable
|
self.scene) # @UndefinedVariable
|
||||||
|
|
||||||
|
@ -2230,7 +2234,6 @@ class CMD_ShowSeasonList(ApiCall):
|
||||||
for row in sqlResults:
|
for row in sqlResults:
|
||||||
seasonList.append(int(row["season"]))
|
seasonList.append(int(row["season"]))
|
||||||
|
|
||||||
|
|
||||||
return _responds(RESULT_SUCCESS, seasonList)
|
return _responds(RESULT_SUCCESS, seasonList)
|
||||||
|
|
||||||
|
|
||||||
|
@ -2293,7 +2296,6 @@ class CMD_ShowSeasons(ApiCall):
|
||||||
seasons[curEpisode] = {}
|
seasons[curEpisode] = {}
|
||||||
seasons[curEpisode] = row
|
seasons[curEpisode] = row
|
||||||
|
|
||||||
|
|
||||||
return _responds(RESULT_SUCCESS, seasons)
|
return _responds(RESULT_SUCCESS, seasons)
|
||||||
|
|
||||||
|
|
||||||
|
@ -2462,7 +2464,6 @@ class CMD_ShowStats(ApiCall):
|
||||||
")", "")
|
")", "")
|
||||||
episodes_stats[statusString] = episode_status_counts_total[statusCode]
|
episodes_stats[statusString] = episode_status_counts_total[statusCode]
|
||||||
|
|
||||||
|
|
||||||
return _responds(RESULT_SUCCESS, episodes_stats)
|
return _responds(RESULT_SUCCESS, episodes_stats)
|
||||||
|
|
||||||
|
|
||||||
|
@ -2521,17 +2522,23 @@ class CMD_Shows(ApiCall):
|
||||||
if self.paused != None and bool(self.paused) != bool(curShow.paused):
|
if self.paused != None and bool(self.paused) != bool(curShow.paused):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
showDict = {"paused": curShow.paused,
|
showDict = {
|
||||||
|
"paused": curShow.paused,
|
||||||
"quality": _get_quality_string(curShow.quality),
|
"quality": _get_quality_string(curShow.quality),
|
||||||
"language": curShow.lang,
|
"language": curShow.lang,
|
||||||
"air_by_date": curShow.air_by_date,
|
"air_by_date": curShow.air_by_date,
|
||||||
"sports": curShow.sports,
|
"sports": curShow.sports,
|
||||||
|
"anime": curShow.anime,
|
||||||
"indexerid": curShow.indexerid,
|
"indexerid": curShow.indexerid,
|
||||||
"tvdbid": curShow.indexerid,
|
"tvdbid": curShow.indexerid,
|
||||||
|
"tvrage_id": curShow.indexerid,
|
||||||
|
"tvrage_name": curShow.name,
|
||||||
"network": curShow.network,
|
"network": curShow.network,
|
||||||
"show_name": curShow.name,
|
"show_name": curShow.name,
|
||||||
"status": curShow.status,
|
"status": curShow.status,
|
||||||
"next_ep_airdate": nextAirdate}
|
"next_ep_airdate": nextAirdate
|
||||||
|
}
|
||||||
|
|
||||||
showDict["cache"] = CMD_ShowCache(self.handler, (), {"indexerid": curShow.indexerid}).run()["data"]
|
showDict["cache"] = CMD_ShowCache(self.handler, (), {"indexerid": curShow.indexerid}).run()["data"]
|
||||||
if not showDict["network"]:
|
if not showDict["network"]:
|
||||||
showDict["network"] = ""
|
showDict["network"] = ""
|
||||||
|
|
Loading…
Reference in a new issue