-
-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #230 from neilsb/tv-new-grid
Implement new ItemGrid for TV Shows
- Loading branch information
Showing
9 changed files
with
71 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
sub setFields() | ||
|
||
' print "Setting Fields in MovieData - " m.top.json.name | ||
json = m.top.json | ||
|
||
m.top.id = json.id | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,49 @@ | ||
sub setFields() | ||
datum = m.top.json | ||
m.top.id = datum.id | ||
m.top.title = datum.name | ||
m.top.overview = datum.overview | ||
json = m.top.json | ||
|
||
setPoster() | ||
m.top.id = json.id | ||
m.top.Title = json.name | ||
m.top.Description = json.overview | ||
m.top.favorite = json.UserData.isFavorite | ||
m.top.watched = json.UserData.played | ||
m.top.Type = "Series" | ||
m.top.overview = json.overview | ||
|
||
if json.ProductionYear <> invalid then | ||
m.top.SubTitle = json.ProductionYear | ||
end if | ||
|
||
'm.top.seasons = TVSeasons(datum.id) | ||
'm.top.nextup = TVNext(datum.id) | ||
if json.OfficialRating <> invalid and json.OfficialRating <> "" then | ||
m.top.Rating = json.OfficialRating | ||
if m.top.SubTitle <> "" then | ||
m.top.SubTitle = m.top.SubTitle + " - " + m.top.Rating | ||
else | ||
m.top.SubTitle = m.top.Rating | ||
end if | ||
end if | ||
|
||
setPoster() | ||
end sub | ||
|
||
sub setPoster() | ||
if m.top.image <> invalid | ||
m.top.posterURL = m.top.image.url | ||
else | ||
m.top.posterURL = "" | ||
if m.top.image <> invalid | ||
m.top.posterURL = m.top.image.url | ||
else | ||
|
||
if m.top.json.ImageTags.Primary <> invalid then | ||
|
||
imgParams = { "maxHeight": 440, "maxWidth": 295, "Tag" : m.top.json.ImageTags.Primary } | ||
m.top.posterURL = ImageURL(m.top.json.id, "Primary", imgParams) | ||
else if m.top.json.BackdropImageTags <> invalid then | ||
imgParams = { "maxHeight": 440, "Tag" : m.top.json.BackdropImageTags[0] } | ||
m.top.posterURL = ImageURL(m.top.json.id, "Backdrop", imgParams) | ||
end if | ||
end sub | ||
|
||
' Add Backdrop Image | ||
if m.top.json.BackdropImageTags <> invalid then | ||
imgParams = { "maxHeight": 720, "maxWidth": 1280, "Tag" : m.top.json.BackdropImageTags[0] } | ||
m.top.backdropURL = ImageURL(m.top.json.id, "Backdrop", imgParams) | ||
end if | ||
|
||
end if | ||
end sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<component name="SeriesData" extends="ContentNode"> | ||
<component name="SeriesData" extends="JFContentItem"> | ||
<interface> | ||
<field id="id" type="string" /> | ||
<field id="title" type="string" /> | ||
<field id="overview" type="string" /> | ||
<field id="seasons" type="associativearray" /> | ||
<field id="nextup" type="associativearray" /> | ||
<field id="image" type="node" onChange="setPoster" /> | ||
<field id="posterURL" type="string" /> | ||
<field id="json" type="associativearray" onChange="setFields" /> | ||
<function name="loadSeasons" /> | ||
</interface> | ||
<script type="text/brightscript" uri="SeriesData.brs" /> | ||
<script type="text/brightscript" uri="pkg:/source/api/Image.brs" /> | ||
<script type="text/brightscript" uri="pkg:/source/api/baserequest.brs" /> | ||
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" /> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters