Skip to content

Commit

Permalink
Add tvshow status
Browse files Browse the repository at this point in the history
  • Loading branch information
angelblue05 committed Dec 13, 2018
1 parent 9014365 commit 576c479
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
7 changes: 6 additions & 1 deletion objects/actions.py
Expand Up @@ -381,9 +381,14 @@ def listitem_video(self, obj, listitem, item, seektime=None):
listitem.setProperty('IsFolder', 'true')

elif obj['Type'] == 'Series':

if obj['Status'] != 'Ended':
obj['Status'] = None

metadata.update({
'mediatype': "tvshow",
'tvshowtitle': obj['Title']
'tvshowtitle': obj['Title'],
'status': obj['Status']
})
listitem.setProperty('TotalSeasons', str(obj['ChildCount']))
listitem.setProperty('TotalEpisodes', str(obj['RecursiveCount']))
Expand Down
8 changes: 4 additions & 4 deletions objects/kodi/queries.py
Expand Up @@ -320,10 +320,10 @@
add_musicvideo_obj = [ "{MvideoId}","{FileId}","{Title}","{Runtime}","{Directors}","{Studio}","{Year}",
"{Plot}","{Album}","{Artists}","{Genre}","{Index}","{Premiere}"
]
add_tvshow = """ INSERT INTO tvshow(idShow, c00, c01, c04, c05, c08, c09, c12, c13, c14, c15)
add_tvshow = """ INSERT INTO tvshow(idShow, c00, c01, c02, c04, c05, c08, c09, c12, c13, c14, c15)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

This comment has been minimized.

Copy link
@sualfred

sualfred Dec 13, 2018

Collaborator

Missing "?" for added c02
It has to be "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) "

"""
add_tvshow_obj = [ "{ShowId}","{Title}","{Plot}","{RatingId}","{Premiere}","{Genre}","{Title}",
add_tvshow_obj = [ "{ShowId}","{Title}","{Plot}","{Status}","{RatingId}","{Premiere}","{Genre}","{Title}",
"{Unique}","{Mpaa}","{Studio}","{SortTitle}"
]
add_season = """ INSERT INTO seasons(idSeason, idShow, season)
Expand Down Expand Up @@ -446,11 +446,11 @@
"{Artists}","{Genre}","{Index}","{Premiere}","{MvideoId}"
]
update_tvshow = """ UPDATE tvshow
SET c00 = ?, c01 = ?, c04 = ?, c05 = ?, c08 = ?, c09 = ?,
SET c00 = ?, c01 = ?, c02 = ?, c04 = ?, c05 = ?, c08 = ?, c09 = ?,
c12 = ?, c13 = ?, c14 = ?, c15 = ?
WHERE idShow = ?
"""
update_tvshow_obj = [ "{Title}","{Plot}","{RatingId}","{Premiere}","{Genre}","{Title}",
update_tvshow_obj = [ "{Title}","{Plot}","{Status}","{RatingId}","{Premiere}","{Genre}","{Title}",
"{Unique}","{Mpaa}","{Studio}","{SortTitle}","{ShowId}"
]
update_tvshow_link = """ INSERT OR REPLACE INTO tvshowlinkpath(idShow, idPath)
Expand Down
6 changes: 4 additions & 2 deletions objects/obj_map.json
Expand Up @@ -77,7 +77,8 @@
"Tags": "Tags",
"Favorite": "UserData/IsFavorite",
"RecursiveCount": "RecursiveItemCount",
"EmbyParentId": "ParentId"
"EmbyParentId": "ParentId",
"Status": "Status"
},
"Season": {
"Id": "Id",
Expand Down Expand Up @@ -301,7 +302,8 @@
"ChildCount": "ChildCount",
"RecursiveCount": "RecursiveItemCount",
"MediaType": "MediaType",
"CriticRating": "CriticRating"
"CriticRating": "CriticRating",
"Status": "Status"
},
"BrowseAudio": {
"Id": "Id",
Expand Down
3 changes: 3 additions & 0 deletions objects/tvshows.py
Expand Up @@ -101,6 +101,9 @@ def tvshow(self, item, e_item, library):
obj['Studio'] = " / ".join(obj['Studios'])
obj['Artwork'] = API.get_all_artwork(self.objects.map(item, 'Artwork'))

if obj['Status'] != 'Ended':
obj['Status'] = None

self.get_path_filename(obj)

if obj['Premiere']:
Expand Down

0 comments on commit 576c479

Please sign in to comment.