Create fallback type if no results are found
This commit is contained in:
parent
577569a26f
commit
874eedecd7
|
@ -102,6 +102,7 @@ sub loadInitialItems()
|
||||||
m.loadItemsTask.itemType = "Series"
|
m.loadItemsTask.itemType = "Series"
|
||||||
else if m.top.parentItem.collectionType = "music"
|
else if m.top.parentItem.collectionType = "music"
|
||||||
m.loadItemsTask.itemType = "MusicArtist"
|
m.loadItemsTask.itemType = "MusicArtist"
|
||||||
|
m.loadItemsTask.fallbackType = "MusicAlbum"
|
||||||
m.loadItemsTask.recursive = false
|
m.loadItemsTask.recursive = false
|
||||||
else if m.top.parentItem.collectionType = "livetv"
|
else if m.top.parentItem.collectionType = "livetv"
|
||||||
m.loadItemsTask.itemType = "LiveTV"
|
m.loadItemsTask.itemType = "LiveTV"
|
||||||
|
|
|
@ -59,11 +59,12 @@ sub loadItems()
|
||||||
|
|
||||||
if data.TotalRecordCount <> invalid then m.top.totalRecordCount = data.TotalRecordCount
|
if data.TotalRecordCount <> invalid then m.top.totalRecordCount = data.TotalRecordCount
|
||||||
|
|
||||||
' When loading the music collection, if no artists are found, try searching by albums
|
' When loading a collection, if no results are found, try searching by fallback type
|
||||||
if m.top.collectionType = "music"
|
if data.TotalRecordCount = 0
|
||||||
if m.top.ItemType = "MusicArtist"
|
if m.top.FallbackType <> ""
|
||||||
if data.TotalRecordCount = 0
|
' Ensure we didn't just search by the fallback type - prevent infinite loop
|
||||||
m.top.ItemType = "MusicAlbum"
|
if m.top.ItemType <> m.top.FallbackType
|
||||||
|
m.top.ItemType = m.top.FallbackType
|
||||||
loadItems()
|
loadItems()
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
<field id="itemId" type="string" />
|
<field id="itemId" type="string" />
|
||||||
<field id="startIndex" type="integer" value="0" />
|
<field id="startIndex" type="integer" value="0" />
|
||||||
<field id="itemType" type="string" value="" />
|
<field id="itemType" type="string" value="" />
|
||||||
|
<field id="fallbackType" type="string" value="" />
|
||||||
<field id="limit" type="integer" value="60" />
|
<field id="limit" type="integer" value="60" />
|
||||||
<field id="metadata" type="assocarray" />
|
<field id="metadata" type="assocarray" />
|
||||||
<field id="sortField" type="string" value="SortName" />
|
<field id="sortField" type="string" value="SortName" />
|
||||||
|
|
Loading…
Reference in New Issue
Block a user