move music video dto code to right method

This commit is contained in:
Luke Pulverenti 2013-07-22 20:03:33 -04:00
parent 5435c66c52
commit ea936ab489

View File

@ -707,25 +707,25 @@ namespace MediaBrowser.Controller.Dto
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);
}
}
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.Artists = string.IsNullOrEmpty(item.Artist) ? new string[] { } : new[] { item.Artist };
}