sync updates

This commit is contained in:
Luke Pulverenti
2014-12-28 12:59:40 -05:00
parent 5278959ede
commit 726cf9697a
56 changed files with 184 additions and 134 deletions

View File

@@ -370,6 +370,7 @@
<Compile Include="Sync\DeviceFileInfo.cs" />
<Compile Include="Sync\ItemFIleInfo.cs" />
<Compile Include="Sync\ItemFileType.cs" />
<Compile Include="Sync\LocalItem.cs" />
<Compile Include="Sync\SyncCategory.cs" />
<Compile Include="Sync\SyncDialogOptions.cs" />
<Compile Include="Sync\SyncedItem.cs" />

View File

@@ -72,7 +72,7 @@ namespace MediaBrowser.Model.Net
{".asf", "video/x-ms-asf"},
{".m4v", "video/x-m4v"}
};
private static readonly Dictionary<string, string> ExtensionLookup =
MimeTypeLookup
.GroupBy(i => i.Value)
@@ -267,7 +267,17 @@ namespace MediaBrowser.Model.Net
public static string ToExtension(string mimeType)
{
return ExtensionLookup[mimeType];
if (string.IsNullOrEmpty(mimeType))
{
throw new ArgumentNullException("mimeType");
}
string result;
if (ExtensionLookup.TryGetValue(mimeType, out result))
{
return result;
}
throw new ArgumentNullException("Unable to determine extension for mimeType: " + mimeType);
}
}
}

View File

@@ -24,10 +24,5 @@ namespace MediaBrowser.Model.Sync
/// </summary>
/// <value>The type of the image.</value>
public ImageType ImageType { get; set; }
/// <summary>
/// Gets or sets the item identifier.
/// </summary>
/// <value>The item identifier.</value>
public string ItemId { get; set; }
}
}

View File

@@ -0,0 +1,33 @@
using MediaBrowser.Model.Dto;
namespace MediaBrowser.Model.Sync
{
public class LocalItem
{
/// <summary>
/// Gets or sets the item.
/// </summary>
/// <value>The item.</value>
public BaseItemDto Item { get; set; }
/// <summary>
/// Gets or sets the local path.
/// </summary>
/// <value>The local path.</value>
public string[] LocalPath { get; set; }
/// <summary>
/// Gets or sets the server identifier.
/// </summary>
/// <value>The server identifier.</value>
public string ServerId { get; set; }
/// <summary>
/// Gets or sets the unique identifier.
/// </summary>
/// <value>The unique identifier.</value>
public string UniqueId { get; set; }
/// <summary>
/// Gets or sets the item identifier.
/// </summary>
/// <value>The item identifier.</value>
public string ItemId { get; set; }
}
}