Beispiel #1
0
        public static void PutAsMetadata([NotNull] ProvidedTrack builder,
                                         [NotNull] ImageGroup group)
        {
            foreach (var image in group.Image)
            {
                String key;
                switch (image.Size)
                {
                case global::SpotifyProto.Image.Types.Size.Default:
                    key = "image_url";
                    break;

                case global::SpotifyProto.Image.Types.Size.Small:
                    key = "image_small_url";
                    break;

                case global::SpotifyProto.Image.Types.Size.Large:
                    key = "image_large_url";
                    break;

                case global::SpotifyProto.Image.Types.Size.Xlarge:
                    key = "image_xlarge_url";
                    break;

                default:
                    continue;
                }

                builder.Metadata[key] = new ImageId(image.FileId).Uri;
            }
        }
Beispiel #2
0
 public static IPlayableId From([NotNull] ProvidedTrack track)
 {
     if (track.Uri.Contains("episode"))
     {
         return(new EpisodeId(track.Uri));
     }
     return(new TrackId(track.Uri));
 }