diff --git a/components/ItemGrid/LoadItemsTask2.bs b/components/ItemGrid/LoadItemsTask2.bs index f4688ff1..d55ab0ec 100644 --- a/components/ItemGrid/LoadItemsTask2.bs +++ b/components/ItemGrid/LoadItemsTask2.bs @@ -164,6 +164,8 @@ sub loadItems() tmp.image = PosterImage(item.id, { "maxHeight": 425, "maxWidth": 290, "quality": "90" }) else if item.type = "Episode" tmp = CreateObject("roSGNode", "TVEpisode") + else if LCase(item.Type) = "recording" + tmp = CreateObject("roSGNode", "RecordingData") else if item.Type = "Genre" tmp = CreateObject("roSGNode", "ContentNode") tmp.title = item.name diff --git a/components/ItemGrid/LoadVideoContentTask.bs b/components/ItemGrid/LoadVideoContentTask.bs index b2d4bcb9..43a20ed3 100644 --- a/components/ItemGrid/LoadVideoContentTask.bs +++ b/components/ItemGrid/LoadVideoContentTask.bs @@ -82,8 +82,8 @@ sub LoadItems_AddVideoContent(video as object, mediaSourceId as dynamic, audio_s videotype = LCase(meta.type) - ' Check for any Live TV streams coming from other places other than the TV Guide - if isValid(meta.json) and isValid(meta.json.ChannelId) + ' Check for any Live TV streams or Recordings coming from other places other than the TV Guide + if videotype = "recording" or (isValid(meta.json) and isValid(meta.json.ChannelId)) if isValid(meta.json.EpisodeTitle) meta.title = meta.json.EpisodeTitle else if isValid(meta.json.Name) diff --git a/components/data/HomeData.bs b/components/data/HomeData.bs index 6309a750..19627450 100644 --- a/components/data/HomeData.bs +++ b/components/data/HomeData.bs @@ -31,7 +31,7 @@ sub setData() m.top.iconUrl = "pkg:/images/media_type_icons/folder_white.png" end if - else if datum.type = "Episode" or datum.type = "MusicVideo" + else if datum.type = "Episode" or LCase(datum.type) = "recording" or datum.type = "MusicVideo" m.top.isWatched = datum.UserData.Played imgParams = {} diff --git a/components/data/RecordingData.bs b/components/data/RecordingData.bs new file mode 100644 index 00000000..b69f17cb --- /dev/null +++ b/components/data/RecordingData.bs @@ -0,0 +1,20 @@ +import "pkg:/source/utils/misc.bs" + +sub setFields() + datum = m.top.json + + m.top.id = datum.id + m.top.title = datum.name + m.top.showID = datum.SeriesID + m.top.seasonID = datum.SeasonID + m.top.overview = datum.overview + m.top.favorite = datum.UserData.isFavorite +end sub + +sub setPoster() + if isValid(m.top.image) + m.top.posterURL = m.top.image.url + else + m.top.posterURL = "" + end if +end sub diff --git a/components/data/RecordingData.xml b/components/data/RecordingData.xml new file mode 100644 index 00000000..f192ad3e --- /dev/null +++ b/components/data/RecordingData.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/components/home/HomeItem.bs b/components/home/HomeItem.bs index 04ea2ec8..1048980f 100644 --- a/components/home/HomeItem.bs +++ b/components/home/HomeItem.bs @@ -121,7 +121,7 @@ sub itemContentChanged() return end if - if itemData.type = "Episode" + if itemData.type = "Episode" or LCase(itemData.type) = "recording" m.itemText.text = itemData.json.SeriesName if itemData.PlayedPercentage > 0 diff --git a/components/manager/QueueManager.bs b/components/manager/QueueManager.bs index 8dcc921b..264bf1a0 100644 --- a/components/manager/QueueManager.bs +++ b/components/manager/QueueManager.bs @@ -145,6 +145,11 @@ sub playQueue() return end if + if nextItemMediaType = "recording" + CreateVideoPlayerView() + return + end if + if nextItemMediaType = "trailer" CreateVideoPlayerView() return diff --git a/source/Main.bs b/source/Main.bs index af425759..163d2e28 100644 --- a/source/Main.bs +++ b/source/Main.bs @@ -166,7 +166,7 @@ sub Main (args as dynamic) as void m.global.queueManager.callFunc("clear") ' empty queue/playlist m.global.queueManager.callFunc("resetShuffle") ' turn shuffle off - if itemType = "episode" or itemType = "movie" or itemType = "video" + if itemType = "episode" or itemType = "recording" or itemType = "movie" or itemType = "video" quickplay.video(itemNode) ' restore focus if LCase(group.subtype()) = "tvepisodes" @@ -242,8 +242,8 @@ sub Main (args as dynamic) as void else if selectedItemType = "UserView" or selectedItemType = "Folder" or selectedItemType = "Channel" or selectedItemType = "Boxset" group = CreateItemGrid(selectedItem) sceneManager.callFunc("pushScene", group) - else if selectedItemType = "Episode" - ' User has selected a TV episode they want us to play + else if selectedItemType = "Episode" or LCase(selectedItemType) = "recording" + ' User has selected a TV episode or Recording they want us to play audio_stream_idx = 0 if isValid(selectedItem.selectedAudioStreamIndex) and selectedItem.selectedAudioStreamIndex > 0 audio_stream_idx = selectedItem.selectedAudioStreamIndex @@ -482,7 +482,7 @@ sub Main (args as dynamic) as void startLoadingSpinner() node = getMsgPicker(msg) ' TODO - swap this based on target.mediatype - ' types: [ Series (Show), Episode, Movie, Audio, Person, Studio, MusicArtist ] + ' types: [ Series (Show), Episode, Movie, Audio, Person, Studio, MusicArtist, Recording ] if node.type = "Series" group = CreateSeriesDetailsGroup(node.id) else if node.type = "Movie" @@ -506,6 +506,9 @@ sub Main (args as dynamic) as void else if node.type = "Episode" group = CreateVideoPlayerGroup(node.id) sceneManager.callFunc("pushScene", group) + else if LCase(node.type) = "recording" + group = CreateVideoPlayerGroup(node.id) + sceneManager.callFunc("pushScene", group) else if node.type = "Audio" selectedIndex = msg.getData() screenContent = msg.getRoSGNode() diff --git a/source/api/Items.bs b/source/api/Items.bs index d77e98cb..a4e9aa74 100644 --- a/source/api/Items.bs +++ b/source/api/Items.bs @@ -97,6 +97,11 @@ function ItemMetaData(id as string) tmp.image = PosterImage(data.id, imgParams) tmp.json = data return tmp + else if LCase(data.type) = "recording" + tmp = CreateObject("roSGNode", "RecordingData") + tmp.image = PosterImage(data.id, imgParams) + tmp.json = data + return tmp else if data.type = "BoxSet" or data.type = "Playlist" tmp = CreateObject("roSGNode", "CollectionData") tmp.image = PosterImage(data.id, imgParams) diff --git a/source/utils/quickplay.bs b/source/utils/quickplay.bs index a022be0f..cca3dfa9 100644 --- a/source/utils/quickplay.bs +++ b/source/utils/quickplay.bs @@ -408,7 +408,7 @@ namespace quickplay ' get watched episodes by the person personEpisodes = api.users.GetItemsByQuery(m.global.session.user.id, { "personIds": itemNode.id, - "includeItemTypes": "Episode", + "includeItemTypes": ["Episode", "Recording"], "isPlayed": true, "excludeItemTypes": "Season,Series", "recursive": true, @@ -474,7 +474,7 @@ namespace quickplay if not isValid(itemNode) or not isValid(itemNode.id) then return paramArray = { - "includeItemTypes": ["Episode", "Movie", "Video"], + "includeItemTypes": ["Episode", "Recording", "Movie", "Video"], "videoTypes": "VideoFile", "sortBy": "Random", "limit": 2000,