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_source = $sbRoot + $epResult["location"].replace($video_root, '/videos')
|
||||
<div id="$video_source" class="jwvideo">Loading the player...</div>
|
||||
#else:
|
||||
No Video
|
||||
#end if
|
||||
</td>
|
||||
#end if
|
||||
|
|
|
@ -25,7 +25,7 @@ $(document).ready(function () {
|
|||
});
|
||||
|
||||
$('#changeStatus').click(function () {
|
||||
var sbRoot = $('#sbRoot').val()
|
||||
var sbRoot = $('#sbRoot').val();
|
||||
var epArr = new Array()
|
||||
|
||||
$('.epCheck').each(function () {
|
||||
|
@ -37,9 +37,9 @@ $(document).ready(function () {
|
|||
});
|
||||
|
||||
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
|
||||
|
||||
});
|
||||
|
@ -49,7 +49,7 @@ $(document).ready(function () {
|
|||
var seasNo = $(seasCheck).attr('id');
|
||||
|
||||
$('.epCheck:visible').each(function () {
|
||||
var epParts = $(this).attr('id').split('x')
|
||||
var epParts = $(this).attr('id').split('x');
|
||||
|
||||
if (epParts[0] == seasNo) {
|
||||
this.checked = seasCheck.checked
|
||||
|
@ -105,18 +105,18 @@ $(document).ready(function () {
|
|||
|
||||
// handle the show selection dropbox
|
||||
$('#pickShow').change(function () {
|
||||
var sbRoot = $('#sbRoot').val()
|
||||
var val = $(this).attr('value')
|
||||
var sbRoot = $('#sbRoot').val();
|
||||
var val = $(this).attr('value');
|
||||
if (val == 0)
|
||||
return
|
||||
url = sbRoot + '/home/displayShow?show=' + val
|
||||
return;
|
||||
url = sbRoot + '/home/displayShow?show=' + val;
|
||||
window.location.href = url
|
||||
});
|
||||
|
||||
// show/hide different types of rows when the checkboxes are changed
|
||||
$("#checkboxControls input").change(function (e) {
|
||||
var whichClass = $(this).attr('id')
|
||||
$(this).showHideRows(whichClass)
|
||||
var whichClass = $(this).attr('id');
|
||||
$(this).showHideRows(whichClass);
|
||||
|
||||
$('tr.' + whichClass).each(function (i) {
|
||||
$(this).toggle();
|
||||
|
@ -137,7 +137,7 @@ $(document).ready(function () {
|
|||
|
||||
$.fn.showHideRows = function (whichClass) {
|
||||
|
||||
var status = $('#checkboxControls > input, #' + whichClass).prop('checked')
|
||||
var status = $('#checkboxControls > input, #' + whichClass).prop('checked');
|
||||
$("tr." + whichClass).each(function (e) {
|
||||
if (status) {
|
||||
$(this).show();
|
||||
|
@ -148,21 +148,21 @@ $(document).ready(function () {
|
|||
|
||||
// hide season headers with no episodes under them
|
||||
$('tr.seasonheader').each(function () {
|
||||
var numRows = 0
|
||||
var seasonNo = $(this).attr('id')
|
||||
var numRows = 0;
|
||||
var seasonNo = $(this).attr('id');
|
||||
$('tr.' + seasonNo + ' :visible').each(function () {
|
||||
numRows++
|
||||
})
|
||||
});
|
||||
if (numRows == 0) {
|
||||
$(this).hide()
|
||||
$(this).hide();
|
||||
$('#' + seasonNo + '-cols').hide()
|
||||
} else {
|
||||
$(this).show()
|
||||
$(this).show();
|
||||
$('#' + seasonNo + '-cols').show()
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function setEpisodeSceneNumbering(forSeason, forEpisode, sceneSeason, sceneEpisode) {
|
||||
var sbRoot = $('#sbRoot').val();
|
||||
|
|
|
@ -98,7 +98,8 @@ class Api(webserve.MainHandler):
|
|||
|
||||
# if debug was set call the "_call_dispatcher"
|
||||
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"]
|
||||
else: # if debug was not set we wrap the "call_dispatcher" in a try block to assure a json output
|
||||
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 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
|
||||
if args:
|
||||
|
@ -502,9 +503,9 @@ class TVDBShorthandWrapper(ApiCall):
|
|||
return CMD_Show(self.handler, args, self.kwargs).run()
|
||||
|
||||
|
||||
################################
|
||||
# ###############################
|
||||
# helper functions #
|
||||
################################
|
||||
# ###############################
|
||||
|
||||
def _sizeof_fmt(num):
|
||||
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 "
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------------#
|
||||
# -------------------------------------------------------------------------------------#
|
||||
|
||||
|
||||
class CMD_Help(ApiCall):
|
||||
|
@ -1008,7 +1009,6 @@ class CMD_EpisodeSetStatus(ApiCall):
|
|||
myDB = db.DBConnection()
|
||||
myDB.mass_action(sql_l)
|
||||
|
||||
|
||||
extra_msg = ""
|
||||
if start_backlog:
|
||||
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(
|
||||
(datetime.datetime.today() - datetime.timedelta(days=30)).strftime(history.dateFormat)))
|
||||
|
||||
|
||||
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
|
||||
nextBacklog = sickbeard.backlogSearchScheduler.nextRun().strftime(dateFormat).decode(sickbeard.SYS_ENCODING)
|
||||
|
||||
|
||||
data = {"backlog_is_paused": int(backlogPaused), "backlog_is_running": int(backlogRunning),
|
||||
"last_backlog": _ordinal_to_dateForm(sqlResults[0]["last_backlog"]),
|
||||
"next_backlog": nextBacklog}
|
||||
|
@ -1750,10 +1748,13 @@ class CMD_Show(ApiCall):
|
|||
showDict["show_name"] = showObj.name
|
||||
showDict["paused"] = showObj.paused
|
||||
showDict["air_by_date"] = showObj.air_by_date
|
||||
showDict["sports"] = showObj.sports
|
||||
showDict["flatten_folders"] = showObj.flatten_folders
|
||||
showDict["sports"] = showObj.sports
|
||||
showDict["anime"] = showObj.anime
|
||||
#clean up tvdb horrible airs field
|
||||
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
|
||||
if not showDict["network"]:
|
||||
showDict["network"] = ""
|
||||
|
@ -1820,7 +1821,8 @@ class CMD_ShowAddExisting(ApiCall):
|
|||
return _responds(RESULT_FAILURE, msg='Not a valid location')
|
||||
|
||||
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 not indexerResult['data']['results']:
|
||||
|
@ -1982,7 +1984,8 @@ class CMD_ShowAddNew(ApiCall):
|
|||
newStatus = self.status
|
||||
|
||||
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 not indexerResult['data']['results']:
|
||||
|
@ -2008,7 +2011,8 @@ class CMD_ShowAddNew(ApiCall):
|
|||
else:
|
||||
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,
|
||||
self.scene) # @UndefinedVariable
|
||||
|
||||
|
@ -2230,7 +2234,6 @@ class CMD_ShowSeasonList(ApiCall):
|
|||
for row in sqlResults:
|
||||
seasonList.append(int(row["season"]))
|
||||
|
||||
|
||||
return _responds(RESULT_SUCCESS, seasonList)
|
||||
|
||||
|
||||
|
@ -2293,7 +2296,6 @@ class CMD_ShowSeasons(ApiCall):
|
|||
seasons[curEpisode] = {}
|
||||
seasons[curEpisode] = row
|
||||
|
||||
|
||||
return _responds(RESULT_SUCCESS, seasons)
|
||||
|
||||
|
||||
|
@ -2462,7 +2464,6 @@ class CMD_ShowStats(ApiCall):
|
|||
")", "")
|
||||
episodes_stats[statusString] = episode_status_counts_total[statusCode]
|
||||
|
||||
|
||||
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):
|
||||
continue
|
||||
|
||||
showDict = {"paused": curShow.paused,
|
||||
showDict = {
|
||||
"paused": curShow.paused,
|
||||
"quality": _get_quality_string(curShow.quality),
|
||||
"language": curShow.lang,
|
||||
"air_by_date": curShow.air_by_date,
|
||||
"sports": curShow.sports,
|
||||
"anime": curShow.anime,
|
||||
"indexerid": curShow.indexerid,
|
||||
"tvdbid": curShow.indexerid,
|
||||
"tvrage_id": curShow.indexerid,
|
||||
"tvrage_name": curShow.name,
|
||||
"network": curShow.network,
|
||||
"show_name": curShow.name,
|
||||
"status": curShow.status,
|
||||
"next_ep_airdate": nextAirdate}
|
||||
"next_ep_airdate": nextAirdate
|
||||
}
|
||||
|
||||
showDict["cache"] = CMD_ShowCache(self.handler, (), {"indexerid": curShow.indexerid}).run()["data"]
|
||||
if not showDict["network"]:
|
||||
showDict["network"] = ""
|
||||
|
|
Loading…
Reference in a new issue