Skip to content

Commit 9a4d565

Browse files
committed
Update code docs
1 parent 659f675 commit 9a4d565

12 files changed

Lines changed: 160 additions & 39 deletions

docs/components_home_FavoritesRows.bs.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
"MusicArtist": tr("Artists"),
3434
"MusicAlbum": tr("Albums"),
3535
"Audio": tr("Songs"),
36+
"Video": tr("Videos"),
37+
"MusicVideo": tr("Music Videos"),
38+
"TvChannel": tr("Channels"),
39+
"Recording": tr("Recordings"),
40+
"PhotoAlbum": tr("Photo Albums"),
41+
"Photo": tr("Photos"),
3642
"BoxSet": tr("Collections")
3743
}
3844
m.initialLoadComplete = false
@@ -220,10 +226,13 @@
220226

221227
' Returns the appropriate slot size for a Jellyfin item type.
222228
' Follows the same logic as SearchRow.bs getSlotSizeForType.
229+
' WIDE (16:9) — Episode, Video, MusicVideo, PhotoAlbum, Photo
230+
' SQUARE (1:1) — Music types, Playlist, TvChannel, Recording
231+
' PORTRAIT (2:3) — all others (Movie, Series, Person, BoxSet, etc.)
223232
function getSlotSizeForType(itemType as string) as object
224-
if itemType = "Episode"
233+
if itemType = "Episode" or itemType = "Video" or itemType = "MusicVideo" or itemType = "PhotoAlbum" or itemType = "Photo"
225234
return rowSlotSize.WIDE
226-
else if itemType = "MusicArtist" or itemType = "MusicAlbum" or itemType = "Audio" or itemType = "Playlist"
235+
else if itemType = "MusicArtist" or itemType = "MusicAlbum" or itemType = "Audio" or itemType = "Playlist" or itemType = "TvChannel" or itemType = "Recording"
227236
return rowSlotSize.SQUARE
228237
end if
229238
return rowSlotSize.PORTRAIT

docs/components_home_LoadItemsTask.bs.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,33 @@
129129
for each item in data.Items
130130
' Skip Books for now as we don't support it (issue #558)
131131
if item.Type <> "Book"
132+
' Live TV recordings come back from /Items as the content type (Movie/Episode).
133+
' The only reliable discriminator is the container format: recordings are always
134+
' stored as MPEG transport streams ("ts"), while library items never are.
135+
if LCase(item.Container ?? "") = "ts"
136+
item.Type = "Recording"
137+
end if
132138
results.push(m.transformer.transformBaseItem(item))
133139
end if
134140
end for
135141
end if
136142

143+
' People — favorited persons are not returned by /Items; requires /Persons endpoint.
144+
personData = GetApi().GetPersons({
145+
"IsFavorite": true,
146+
"SortBy": "SortName",
147+
"SortOrder": "Ascending",
148+
"EnableTotalRecordCount": false
149+
})
150+
if isValid(personData) and isValid(personData.Items)
151+
for each item in personData.Items
152+
results.push(m.transformer.transformBaseItem(item))
153+
end for
154+
end if
155+
156+
' Note: MusicArtist items ARE returned by /Items above (they are regular library items),
157+
' so no separate /Artists call is needed here (unlike search, where /Items misses them).
158+
137159
else if m.top.itemsToLoad = "onNow"
138160
url = "LiveTv/Programs/Recommended"
139161
params = {}

docs/components_search_SearchRow.bs.html

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,13 @@
4848
"MusicArtist": { "label": "Artists", "count": 0 },
4949
"MusicAlbum": { "label": "Albums", "count": 0 },
5050
"Audio": { "label": "Songs", "count": 0 },
51+
"Video": { "label": "Videos", "count": 0 },
52+
"MusicVideo": { "label": "Music Videos", "count": 0 },
53+
"Program": { "label": "Programs", "count": 0 },
5154
"TvChannel": { "label": "Channels", "count": 0 },
55+
"Recording": { "label": "Recordings", "count": 0 },
56+
"PhotoAlbum": { "label": "Photo Albums", "count": 0 },
57+
"Photo": { "label": "Photos", "count": 0 },
5258
"BoxSet": { "label": "Collections", "count": 0 }
5359
}
5460

@@ -82,13 +88,13 @@
8288
end sub
8389

8490
' Returns the appropriate slot size for a given Jellyfin item type.
85-
' Episode → WIDE (16:9 screenshots)
86-
' Music and Playlist → SQUARE (1:1 album art)
87-
' All others (Movie, Series, TvChannel, Person, etc.) → PORTRAIT (2:3 poster)
91+
' WIDE (16:9) — Episode, Video, MusicVideo, PhotoAlbum, Photo
92+
' SQUARE (1:1) — Music types, Playlist, Program, TvChannel, Recording
93+
' PORTRAIT (2:3) — all others (Movie, Series, Person, BoxSet, etc.)
8894
function getSlotSizeForType(itemType as string) as object
89-
if itemType = "Episode"
95+
if itemType = "Episode" or itemType = "Video" or itemType = "MusicVideo" or itemType = "PhotoAlbum" or itemType = "Photo"
9096
return rowSlotSize.WIDE
91-
else if itemType = "MusicArtist" or itemType = "MusicAlbum" or itemType = "Audio" or itemType = "Playlist"
97+
else if itemType = "MusicArtist" or itemType = "MusicAlbum" or itemType = "Audio" or itemType = "Playlist" or itemType = "Program" or itemType = "TvChannel" or itemType = "Recording"
9298
return rowSlotSize.SQUARE
9399
end if
94100
return rowSlotSize.PORTRAIT

docs/data/search.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/module-ApiClient.ApiClient.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/module-ApiClient.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/module-FavoritesRows.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/module-SearchRow.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/source_api_ApiClient.bs.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,18 @@
204204
return sdk.artists.Get(mergedParams)
205205
end function
206206

207+
' Get all persons with automatic image injection
208+
' @param params - Query parameters (e.g. searchTerm, IsFavorite)
209+
' @returns API response or invalid on error
210+
function GetPersons(params = {} as object) as dynamic
211+
userId = m.getUserId()
212+
if userId = "" then return invalid
213+
214+
mergedParams = m.injectDefaults(params)
215+
mergedParams.UserId = userId
216+
return sdk.persons.Get(mergedParams)
217+
end function
218+
207219
' Get all album artists with automatic image injection
208220
' @param params - Query parameters
209221
' @returns API response or invalid on error
@@ -668,6 +680,14 @@
668680
return sdk.liveTV.GetChannels(params)
669681
end function
670682

683+
' Get Live TV programs with automatic image injection
684+
' @param params - Query parameters (e.g. SearchTerm, Limit)
685+
' @returns API response or invalid on error
686+
function GetLiveTVPrograms(params = {} as object) as dynamic
687+
mergedParams = m.injectDefaults(params)
688+
return sdk.liveTV.GetPrograms(mergedParams)
689+
end function
690+
671691
' ═══════════════════════════════════════════════════════════════════════════
672692
' STUDIOS ENDPOINTS
673693
' ═══════════════════════════════════════════════════════════════════════════

docs/source_api_Items.bs.html

Lines changed: 63 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -235,32 +235,72 @@
235235

236236
' Search across all libraries
237237
function searchMedia(query as string)
238-
if query <> ""
239-
data = GetApi().GetItemsByQuery({
240-
"searchTerm": query,
241-
"IncludePeople": true,
242-
"IncludeMedia": true,
243-
"IncludeShows": true,
244-
"IncludeGenres": true,
245-
"IncludeStudios": true,
246-
"IncludeArtists": true,
247-
"IncludeItemTypes": "LiveTvChannel,Movie,BoxSet,Series,Episode,Video,Person,Audio,MusicAlbum,MusicArtist,Playlist",
248-
"EnableTotalRecordCount": false,
249-
"Recursive": true,
250-
"limit": 100
251-
})
252-
253-
if not isValid(data) then return []
254-
255-
transformer = JellyfinDataTransformer()
256-
results = []
238+
if query = "" then return []
239+
240+
transformer = JellyfinDataTransformer()
241+
allItems = []
242+
243+
' Regular library items — Person and MusicArtist are fetched via dedicated endpoints below.
244+
' LiveTvProgram is excluded here because /Items EPG search is incomplete; /LiveTv/Programs is used instead.
245+
data = GetApi().GetItemsByQuery({
246+
"searchTerm": query,
247+
"IncludeItemTypes": "Movie,Series,Episode,Video,MusicVideo,Audio,MusicAlbum,Playlist,LiveTvChannel,PhotoAlbum,Photo,BoxSet",
248+
"EnableTotalRecordCount": false,
249+
"Recursive": true,
250+
"limit": 100
251+
})
252+
if isValid(data) and isValid(data.Items)
257253
for each item in data.Items
258-
results.push(transformer.transformBaseItem(item))
254+
' Live TV recordings come back from /Items as the content type (Movie/Episode).
255+
' The only reliable discriminator is the container format: recordings are always
256+
' stored as MPEG transport streams ("ts"), while library items never are.
257+
if LCase(item.Container ?? "") = "ts"
258+
item.Type = "Recording"
259+
end if
260+
allItems.push(transformer.transformBaseItem(item))
261+
end for
262+
end if
263+
264+
' People — /Items does not return Person type; /Persons endpoint required.
265+
personData = GetApi().GetPersons({
266+
"searchTerm": query,
267+
"Limit": 20,
268+
"EnableTotalRecordCount": false
269+
})
270+
if isValid(personData) and isValid(personData.Items)
271+
for each item in personData.Items
272+
allItems.push(transformer.transformBaseItem(item))
273+
end for
274+
end if
275+
276+
' Artists — /Items does not return MusicArtist type; /Artists endpoint required.
277+
artistData = GetApi().GetArtists({
278+
"searchTerm": query,
279+
"Limit": 20,
280+
"EnableTotalRecordCount": false
281+
})
282+
if isValid(artistData) and isValid(artistData.Items)
283+
for each item in artistData.Items
284+
allItems.push(transformer.transformBaseItem(item))
259285
end for
260-
data.Items = results
261-
return data
262286
end if
263-
return []
287+
288+
' Live TV Programs — /LiveTv/Programs searches the full EPG; /Items only covers recordings.
289+
programData = GetApi().GetLiveTVPrograms({
290+
"SearchTerm": query,
291+
"Limit": 20,
292+
"EnableTotalRecordCount": false
293+
})
294+
if isValid(programData) and isValid(programData.Items)
295+
for each item in programData.Items
296+
allItems.push(transformer.transformBaseItem(item))
297+
end for
298+
end if
299+
300+
result = {}
301+
result.Items = allItems
302+
result.TotalRecordCount = allItems.count()
303+
return result
264304
end function
265305

266306
' MetaData about an item — returns a JellyfinBaseItem node.

0 commit comments

Comments
 (0)