sync updates

This commit is contained in:
Luke Pulverenti
2015-03-08 00:37:48 -05:00
parent d9518be3ed
commit 4389f47fb6
6 changed files with 69 additions and 26 deletions

View File

@@ -214,14 +214,14 @@ namespace MediaBrowser.Server.Implementations.Sync
}
}
private string GetLocalId(string serverId, string itemId)
internal static string GetLocalId(string serverId, string itemId)
{
var bytes = Encoding.UTF8.GetBytes(serverId + itemId);
bytes = CreateMD5(bytes);
bytes = CreateMd5(bytes);
return BitConverter.ToString(bytes, 0, bytes.Length).Replace("-", string.Empty);
}
private byte[] CreateMD5(byte[] value)
private static byte[] CreateMd5(byte[] value)
{
using (var provider = MD5.Create())
{
@@ -341,10 +341,6 @@ namespace MediaBrowser.Server.Implementations.Sync
{
itemFile.Type = ItemFileType.Subtitles;
}
else if (!IsImageFile(file.Name))
{
itemFile.Type = ItemFileType.Media;
}
itemFiles.Add(itemFile);
}
@@ -352,14 +348,6 @@ namespace MediaBrowser.Server.Implementations.Sync
return itemFiles;
}
private static readonly string[] SupportedImageExtensions = { ".png", ".jpg", ".jpeg", ".webp" };
private bool IsImageFile(string path)
{
var ext = Path.GetExtension(path) ?? string.Empty;
return SupportedImageExtensions.Contains(ext, StringComparer.OrdinalIgnoreCase);
}
private static readonly string[] SupportedSubtitleExtensions = { ".srt", ".vtt" };
private bool IsSubtitleFile(string path)
{