roadie/Roadie.Dlna.Services/CoverArt.cs
Steven Hildreth c08ce7676c resolves #10
2019-09-04 21:04:20 -05:00

47 lines
No EOL
1.4 KiB
C#

using Roadie.Dlna.Server;
using Roadie.Dlna.Server.Metadata;
using System;
using System.IO;
namespace Roadie.Dlna.Services
{
public sealed class CoverArt : IMediaCoverResource, IMetaInfo
{
private byte[] bytes;
public IMediaCoverResource Cover => this;
public string Id
{
get { throw new NotSupportedException(); }
set { throw new NotSupportedException(); }
}
public DateTime InfoDate { get; }
public long? InfoSize { get; }
public DlnaMediaTypes MediaType => DlnaMediaTypes.Image;
public int? MetaHeight { get; }
public int? MetaWidth { get; }
public string Path => throw new NotImplementedException();
public string PN => "JPEG_TN";
public IHeaders Properties => throw new NotImplementedException();
public string Title => throw new NotImplementedException();
public DlnaMime Type => DlnaMime.ImageJPEG;
public CoverArt(byte[] data, int width, int height)
{
bytes = data;
MetaWidth = width;
MetaHeight = height;
}
public int CompareTo(IMediaItem other) => throw new NotImplementedException();
public Stream CreateContentStream() => new MemoryStream(bytes);
public bool Equals(IMediaItem other) => throw new NotImplementedException();
public string ToComparableTitle() => throw new NotImplementedException();
}
}