mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
move music video dto code to right method
This commit is contained in:
parent
5435c66c52
commit
ea936ab489
@ -707,25 +707,25 @@ namespace MediaBrowser.Controller.Dto
|
|||||||
|
|
||||||
if (musicVideo != null)
|
if (musicVideo != null)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(musicVideo.Album))
|
|
||||||
{
|
|
||||||
var parentAlbum = _libraryManager.RootFolder
|
|
||||||
.RecursiveChildren
|
|
||||||
.OfType<MusicAlbum>()
|
|
||||||
.FirstOrDefault(i => string.Equals(i.Name, musicVideo.Album, StringComparison.OrdinalIgnoreCase));
|
|
||||||
|
|
||||||
if (parentAlbum != null)
|
|
||||||
{
|
|
||||||
dto.AlbumId = GetClientItemId(parentAlbum);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SetMusicVideoProperties(dto, musicVideo);
|
SetMusicVideoProperties(dto, musicVideo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetMusicVideoProperties(BaseItemDto dto, MusicVideo item)
|
private void SetMusicVideoProperties(BaseItemDto dto, MusicVideo item)
|
||||||
{
|
{
|
||||||
|
if (!string.IsNullOrEmpty(item.Album))
|
||||||
|
{
|
||||||
|
var parentAlbum = _libraryManager.RootFolder
|
||||||
|
.RecursiveChildren
|
||||||
|
.OfType<MusicAlbum>()
|
||||||
|
.FirstOrDefault(i => string.Equals(i.Name, item.Album, StringComparison.OrdinalIgnoreCase));
|
||||||
|
|
||||||
|
if (parentAlbum != null)
|
||||||
|
{
|
||||||
|
dto.AlbumId = GetClientItemId(parentAlbum);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dto.Album = item.Album;
|
dto.Album = item.Album;
|
||||||
dto.Artists = string.IsNullOrEmpty(item.Artist) ? new string[] { } : new[] { item.Artist };
|
dto.Artists = string.IsNullOrEmpty(item.Artist) ? new string[] { } : new[] { item.Artist };
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user