mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-09 23:55:10 -05:00
Add ' - SW' suffix to external albums and artists
Makes it easy to distinguish external content from local Jellyfin library
This commit is contained in:
@@ -304,10 +304,17 @@ public class JellyfinResponseBuilder
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Dictionary<string, object?> ConvertAlbumToJellyfinItem(Album album)
|
public Dictionary<string, object?> ConvertAlbumToJellyfinItem(Album album)
|
||||||
{
|
{
|
||||||
|
// Add " - SW" suffix to external album names
|
||||||
|
var albumName = album.Title;
|
||||||
|
if (!album.IsLocal)
|
||||||
|
{
|
||||||
|
albumName = $"{album.Title} - SW";
|
||||||
|
}
|
||||||
|
|
||||||
var item = new Dictionary<string, object?>
|
var item = new Dictionary<string, object?>
|
||||||
{
|
{
|
||||||
["Id"] = album.Id,
|
["Id"] = album.Id,
|
||||||
["Name"] = album.Title,
|
["Name"] = albumName,
|
||||||
["ServerId"] = "allstarr",
|
["ServerId"] = "allstarr",
|
||||||
["Type"] = "MusicAlbum",
|
["Type"] = "MusicAlbum",
|
||||||
["IsFolder"] = true,
|
["IsFolder"] = true,
|
||||||
@@ -328,10 +335,10 @@ public class JellyfinResponseBuilder
|
|||||||
},
|
},
|
||||||
["BackdropImageTags"] = new string[0],
|
["BackdropImageTags"] = new string[0],
|
||||||
["ImageBlurHashes"] = new Dictionary<string, object>(),
|
["ImageBlurHashes"] = new Dictionary<string, object>(),
|
||||||
["LocationType"] = "FileSystem", // External content appears as local files to clients
|
["LocationType"] = "FileSystem",
|
||||||
["MediaType"] = (object?)null, // Match Jellyfin structure
|
["MediaType"] = (object?)null,
|
||||||
["ChannelId"] = (object?)null, // Match Jellyfin structure
|
["ChannelId"] = (object?)null,
|
||||||
["CollectionType"] = (object?)null, // Match Jellyfin structure
|
["CollectionType"] = (object?)null,
|
||||||
["UserData"] = new Dictionary<string, object>
|
["UserData"] = new Dictionary<string, object>
|
||||||
{
|
{
|
||||||
["PlaybackPositionTicks"] = 0,
|
["PlaybackPositionTicks"] = 0,
|
||||||
@@ -364,10 +371,17 @@ public class JellyfinResponseBuilder
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Dictionary<string, object?> ConvertArtistToJellyfinItem(Artist artist)
|
public Dictionary<string, object?> ConvertArtistToJellyfinItem(Artist artist)
|
||||||
{
|
{
|
||||||
|
// Add " - SW" suffix to external artist names
|
||||||
|
var artistName = artist.Name;
|
||||||
|
if (!artist.IsLocal)
|
||||||
|
{
|
||||||
|
artistName = $"{artist.Name} - SW";
|
||||||
|
}
|
||||||
|
|
||||||
var item = new Dictionary<string, object?>
|
var item = new Dictionary<string, object?>
|
||||||
{
|
{
|
||||||
["Id"] = artist.Id,
|
["Id"] = artist.Id,
|
||||||
["Name"] = artist.Name,
|
["Name"] = artistName,
|
||||||
["ServerId"] = "allstarr",
|
["ServerId"] = "allstarr",
|
||||||
["Type"] = "MusicArtist",
|
["Type"] = "MusicArtist",
|
||||||
["IsFolder"] = true,
|
["IsFolder"] = true,
|
||||||
|
|||||||
Reference in New Issue
Block a user