コード例 #1
0
ファイル: PlaylistItem.cs プロジェクト: paukr/auremo
        public PlaylistItem(MPDSongResponseBlock block, DataModel dataModel)
        {
            Path = new Path(block.File);
            Position = block.Pos;
            Id = block.Id;

            if (Path.IsStream())
            {
                Artist = null;
                Album = null;
                AudioStream stream = dataModel.StreamsCollection.StreamByPath(Path);

                if (stream != null)
                {
                    Title = stream.Label;
                }
                else
                {
                    Title = block.Name ?? Path.ToString();
                }
            }
            else
            {
                Title = block.Title;
                Album = block.Album;

                if (Settings.Default.UseAlbumArtist)
                {
                    Artist = block.AlbumArtist ?? block.Artist;
                }

                Artist = block.Artist;
            }
        }