allow separate image extractions for each audio book

This commit is contained in:
Luke Pulverenti 2017-11-02 12:00:58 -04:00
parent 67cf7da8df
commit 7174ee66d5
2 changed files with 22 additions and 12 deletions

View File

@ -106,7 +106,7 @@ namespace Emby.Server.Implementations.Networking
endpoint.StartsWith("127.", StringComparison.OrdinalIgnoreCase) ||
endpoint.StartsWith("192.168", StringComparison.OrdinalIgnoreCase) ||
endpoint.StartsWith("169.", StringComparison.OrdinalIgnoreCase) ||
//endpoint.StartsWith("10.", StringComparison.OrdinalIgnoreCase) ||
endpoint.StartsWith("10.", StringComparison.OrdinalIgnoreCase) ||
IsInPrivateAddressSpaceAndLocalSubnet(endpoint);
}

View File

@ -92,24 +92,34 @@ namespace MediaBrowser.Providers.MediaInfo
private string GetAudioImagePath(Audio item)
{
var filename = item.Album ?? string.Empty;
filename += string.Join(",", item.Artists);
string filename;
if (!string.IsNullOrWhiteSpace(item.Album))
if (item.GetType() == typeof(Audio))
{
filename += "_" + item.Album;
}
else if (!string.IsNullOrWhiteSpace(item.Name))
{
filename += "_" + item.Name;
filename = item.Album ?? string.Empty;
filename += string.Join(",", item.Artists);
if (!string.IsNullOrWhiteSpace(item.Album))
{
filename += "_" + item.Album;
}
else if (!string.IsNullOrWhiteSpace(item.Name))
{
filename += "_" + item.Name;
}
else
{
filename += "_" + item.Id.ToString("N");
}
filename = filename.GetMD5() + ".jpg";
}
else
{
filename += "_" + item.Id.ToString("N");
// If it's an audio book or audio podcast, allow unique image per item
filename = item.Id.ToString("N") + ".jpg";
}
filename = filename.GetMD5() + ".jpg";
var prefix = filename.Substring(0, 1);
return Path.Combine(AudioImagesPath, prefix, filename);