Merge pull request #894 from 1hitsong/ResumableFilter

Add resumable filter to Movies
This commit is contained in:
1hitsong 2022-12-29 09:05:40 -05:00 committed by GitHub
commit 4720f9846c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 35 additions and 2 deletions

View File

@ -243,7 +243,8 @@ sub setMoviesOptions(options)
{ "Title": tr("All"), "Name": "All" },
{ "Title": tr("Favorites"), "Name": "Favorites" },
{ "Title": tr("Played"), "Name": "Played" },
{ "Title": tr("Unplayed"), "Name": "Unplayed" }
{ "Title": tr("Unplayed"), "Name": "Unplayed" },
{ "Title": tr("Resumable"), "Name": "Resumable" }
]
end sub

View File

@ -79,6 +79,8 @@ sub loadItems()
params.append({ Filters: "IsUnplayed" })
else if filter = "played"
params.append({ Filters: "IsPlayed" })
else if filter = "resumable"
params.append({ Filters: "IsResumable" })
end if
if m.top.ItemType <> ""

View File

@ -22,6 +22,7 @@ sub setupNodes()
m.overhang = m.top.getScene().findNode("overhang")
m.genreList = m.top.findNode("genrelist")
m.infoGroup = m.top.findNode("infoGroup")
m.star = m.top.findNode("star")
end sub
sub init()
@ -228,7 +229,8 @@ sub setMoviesOptions(options)
{ "Title": tr("All"), "Name": "All" },
{ "Title": tr("Favorites"), "Name": "Favorites" },
{ "Title": tr("Played"), "Name": "Played" },
{ "Title": tr("Unplayed"), "Name": "Unplayed" }
{ "Title": tr("Unplayed"), "Name": "Unplayed" },
{ "Title": tr("Resumable"), "Name": "Resumable" }
]
if m.options.view = "Genres" or m.view = "Genres"
@ -241,6 +243,10 @@ sub setMoviesOptions(options)
{ "Title": tr("TITLE"), "Name": "SortName" },
{ "Title": tr("DATE_ADDED"), "Name": "DateCreated" },
]
options.filter = [
{ "Title": tr("All"), "Name": "All" },
{ "Title": tr("Favorites"), "Name": "Favorites" }
]
end if
end sub
@ -361,6 +367,24 @@ sub ItemDataLoaded(msg)
m.Loading = false
'If there are no items to display, show message
if m.loadedItems = 0
m.selectedMovieOverview.visible = false
m.infoGroup.visible = false
m.movieLogo.visible = false
m.movieLogo.uri = ""
m.selectedMovieName.visible = false
SetName("")
SetOverview("")
SetOfficialRating("")
SetProductionYear("")
setFieldText("runtime", "")
setFieldText("communityRating", "")
setFieldText("criticRatingLabel", "")
m.criticRatingIcon.uri = ""
m.star.uri = ""
m.emptyText.text = tr("NO_ITEMS").Replace("%1", m.top.parentItem.Type)
m.emptyText.visible = true
end if
@ -438,6 +462,8 @@ sub onItemFocused()
itemData = m.selectedFavoriteItem.json
m.star.uri = "pkg:/images/sharp_star_white_18dp.png"
if isValid(itemData.communityRating)
setFieldText("communityRating", int(itemData.communityRating * 10) / 10)
m.communityRatingGroup.visible = true

View File

@ -928,5 +928,9 @@
<source>Played</source>
<translation>Played</translation>
</message>
<message>
<source>Resumable</source>
<translation>Resumable</translation>
</message>
</context>
</TS>