aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2015-01-04 09:27:54 -0500
committerLuke <luke.pulverenti@gmail.com>2015-01-04 09:27:54 -0500
commitc5ff30f66e368efc2ca7dea7813fba6d9f6a657c (patch)
treec5552b898f66b7d510e9257eb8bbeafd6a003676 /MediaBrowser.Model
parent767590125b27c2498e3ad9544edbede30fb70f45 (diff)
parent59b6bc28c332701d5e383fbf99170bdc740fb6cc (diff)
Merge pull request #965 from MediaBrowser/dev
3.0.5482.0
Diffstat (limited to 'MediaBrowser.Model')
-rw-r--r--MediaBrowser.Model/ApiClient/IApiClient.cs73
-rw-r--r--MediaBrowser.Model/Configuration/CinemaModeConfiguration.cs1
-rw-r--r--MediaBrowser.Model/Configuration/EncodingOptions.cs19
-rw-r--r--MediaBrowser.Model/Configuration/ServerConfiguration.cs32
-rw-r--r--MediaBrowser.Model/Configuration/UserConfiguration.cs13
-rw-r--r--MediaBrowser.Model/Devices/DeviceQuery.cs5
-rw-r--r--MediaBrowser.Model/Dlna/StreamBuilder.cs6
-rw-r--r--MediaBrowser.Model/Dlna/StreamInfo.cs15
-rw-r--r--MediaBrowser.Model/Dto/BaseItemDto.cs13
-rw-r--r--MediaBrowser.Model/Dto/DtoOptions.cs32
-rw-r--r--MediaBrowser.Model/Dto/MetadataEditorInfo.cs27
-rw-r--r--MediaBrowser.Model/Dto/NameValuePair.cs17
-rw-r--r--MediaBrowser.Model/Dto/StreamOptions.cs67
-rw-r--r--MediaBrowser.Model/Dto/VideoStreamOptions.cs58
-rw-r--r--MediaBrowser.Model/MediaBrowser.Model.csproj16
-rw-r--r--MediaBrowser.Model/Net/HttpResponse.cs64
-rw-r--r--MediaBrowser.Model/Net/MimeTypes.cs291
-rw-r--r--MediaBrowser.Model/Querying/ItemFields.cs32
-rw-r--r--MediaBrowser.Model/Session/TranscodingInfo.cs2
-rw-r--r--MediaBrowser.Model/Sync/DeviceFileInfo.cs9
-rw-r--r--MediaBrowser.Model/Sync/ItemFIleInfo.cs28
-rw-r--r--MediaBrowser.Model/Sync/ItemFileType.cs19
-rw-r--r--MediaBrowser.Model/Sync/LocalItem.cs33
-rw-r--r--MediaBrowser.Model/Sync/SyncDataRequest.cs16
-rw-r--r--MediaBrowser.Model/Sync/SyncDataResponse.cs14
-rw-r--r--MediaBrowser.Model/Sync/SyncHelper.cs1
-rw-r--r--MediaBrowser.Model/Sync/SyncJob.cs1
-rw-r--r--MediaBrowser.Model/Sync/SyncJobItem.cs22
-rw-r--r--MediaBrowser.Model/Sync/SyncJobItemQuery.cs16
-rw-r--r--MediaBrowser.Model/Sync/SyncJobItemStatus.cs6
-rw-r--r--MediaBrowser.Model/Sync/SyncJobQuery.cs5
-rw-r--r--MediaBrowser.Model/Sync/SyncQuality.cs6
-rw-r--r--MediaBrowser.Model/Sync/SyncedItem.cs38
-rw-r--r--MediaBrowser.Model/Users/UserAction.cs15
-rw-r--r--MediaBrowser.Model/Users/UserActionType.cs8
-rw-r--r--MediaBrowser.Model/Users/UserPolicy.cs69
36 files changed, 910 insertions, 179 deletions
diff --git a/MediaBrowser.Model/ApiClient/IApiClient.cs b/MediaBrowser.Model/ApiClient/IApiClient.cs
index 9521f8538..9faa8fced 100644
--- a/MediaBrowser.Model/ApiClient/IApiClient.cs
+++ b/MediaBrowser.Model/ApiClient/IApiClient.cs
@@ -7,6 +7,7 @@ using MediaBrowser.Model.Events;
using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.LiveTv;
using MediaBrowser.Model.MediaInfo;
+using MediaBrowser.Model.Net;
using MediaBrowser.Model.Notifications;
using MediaBrowser.Model.Playlists;
using MediaBrowser.Model.Plugins;
@@ -186,6 +187,30 @@ namespace MediaBrowser.Model.ApiClient
Task<Stream> GetImageStreamAsync(string url, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
+ /// Gets the stream.
+ /// </summary>
+ /// <param name="url">The URL.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>Task&lt;Stream&gt;.</returns>
+ Task<Stream> GetStream(string url, CancellationToken cancellationToken = default(CancellationToken));
+
+ /// <summary>
+ /// Gets the response.
+ /// </summary>
+ /// <param name="url">The URL.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>Task&lt;HttpResponse&gt;.</returns>
+ Task<HttpResponse> GetResponse(string url, CancellationToken cancellationToken = default(CancellationToken));
+
+ /// <summary>
+ /// Updates the user configuration.
+ /// </summary>
+ /// <param name="userId">The user identifier.</param>
+ /// <param name="configuration">The configuration.</param>
+ /// <returns>Task.</returns>
+ Task UpdateUserConfiguration(string userId, UserConfiguration configuration);
+
+ /// <summary>
/// Gets a BaseItem
/// </summary>
/// <param name="id">The id.</param>
@@ -497,15 +522,6 @@ namespace MediaBrowser.Model.ApiClient
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;PublicSystemInfo&gt;.</returns>
Task<PublicSystemInfo> GetPublicSystemInfoAsync(CancellationToken cancellationToken = default(CancellationToken));
-
- /// <summary>
- /// Gets a person
- /// </summary>
- /// <param name="name">The name.</param>
- /// <param name="userId">The user id.</param>
- /// <returns>Task{BaseItemDto}.</returns>
- /// <exception cref="ArgumentNullException">userId</exception>
- Task<BaseItemDto> GetPersonAsync(string name, string userId);
/// <summary>
/// Gets a list of plugins installed on the server
@@ -962,15 +978,6 @@ namespace MediaBrowser.Model.ApiClient
/// <summary>
/// Gets an image url that can be used to download an image from the api
/// </summary>
- /// <param name="name">The name of the person</param>
- /// <param name="options">The options.</param>
- /// <returns>System.String.</returns>
- /// <exception cref="ArgumentNullException">name</exception>
- string GetPersonImageUrl(string name, ImageOptions options);
-
- /// <summary>
- /// Gets an image url that can be used to download an image from the api
- /// </summary>
/// <param name="year">The year.</param>
/// <param name="options">The options.</param>
/// <returns>System.String.</returns>
@@ -1310,15 +1317,6 @@ namespace MediaBrowser.Model.ApiClient
Task<QueryResult<BaseItemDto>> GetPlaylistItems(PlaylistItemQuery query);
/// <summary>
- /// Gets the url needed to stream an audio file
- /// </summary>
- /// <param name="options">The options.</param>
- /// <returns>System.String.</returns>
- /// <exception cref="ArgumentNullException">options</exception>
- [Obsolete]
- string GetAudioStreamUrl(StreamOptions options);
-
- /// <summary>
/// Gets the url needed to stream a video file
/// </summary>
/// <param name="options">The options.</param>
@@ -1421,5 +1419,26 @@ namespace MediaBrowser.Model.ApiClient
/// <param name="webSocketFactory">The web socket factory.</param>
/// <param name="keepAliveTimerMs">The keep alive timer ms.</param>
void OpenWebSocket(Func<IClientWebSocket> webSocketFactory, int keepAliveTimerMs = 60000);
+
+ /// <summary>
+ /// Reports the offline actions.
+ /// </summary>
+ /// <param name="actions">The actions.</param>
+ /// <returns>Task.</returns>
+ Task ReportOfflineActions(List<UserAction> actions);
+
+ /// <summary>
+ /// Gets the ready synchronize items.
+ /// </summary>
+ /// <param name="targetId">The target identifier.</param>
+ /// <returns>List&lt;SyncedItem&gt;.</returns>
+ Task<List<SyncedItem>> GetReadySyncItems(string targetId);
+
+ /// <summary>
+ /// Synchronizes the data.
+ /// </summary>
+ /// <param name="request">The request.</param>
+ /// <returns>Task&lt;SyncDataResponse&gt;.</returns>
+ Task<SyncDataResponse> SyncData(SyncDataRequest request);
}
} \ No newline at end of file
diff --git a/MediaBrowser.Model/Configuration/CinemaModeConfiguration.cs b/MediaBrowser.Model/Configuration/CinemaModeConfiguration.cs
index bd20713de..764a7222f 100644
--- a/MediaBrowser.Model/Configuration/CinemaModeConfiguration.cs
+++ b/MediaBrowser.Model/Configuration/CinemaModeConfiguration.cs
@@ -19,6 +19,7 @@ namespace MediaBrowser.Model.Configuration
public CinemaModeConfiguration()
{
EnableIntrosParentalControl = true;
+ EnableIntrosFromSimilarMovies = true;
TrailerLimit = 2;
}
}
diff --git a/MediaBrowser.Model/Configuration/EncodingOptions.cs b/MediaBrowser.Model/Configuration/EncodingOptions.cs
new file mode 100644
index 000000000..f24367298
--- /dev/null
+++ b/MediaBrowser.Model/Configuration/EncodingOptions.cs
@@ -0,0 +1,19 @@
+
+namespace MediaBrowser.Model.Configuration
+{
+ public class EncodingOptions
+ {
+ public EncodingQuality EncodingQuality { get; set; }
+ public string TranscodingTempPath { get; set; }
+ public double DownMixAudioBoost { get; set; }
+ public string H264Encoder { get; set; }
+ public bool EnableDebugLogging { get; set; }
+
+ public EncodingOptions()
+ {
+ H264Encoder = "libx264";
+ DownMixAudioBoost = 2;
+ EncodingQuality = EncodingQuality.Auto;
+ }
+ }
+}
diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
index b9eaf7001..6c941e804 100644
--- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs
+++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
@@ -1,4 +1,5 @@
-using MediaBrowser.Model.Entities;
+using MediaBrowser.Model.Dto;
+using MediaBrowser.Model.Entities;
namespace MediaBrowser.Model.Configuration
{
@@ -32,6 +33,12 @@ namespace MediaBrowser.Model.Configuration
public bool EnableInternetProviders { get; set; }
/// <summary>
+ /// Gets or sets a value indicating whether this instance is port authorized.
+ /// </summary>
+ /// <value><c>true</c> if this instance is port authorized; otherwise, <c>false</c>.</value>
+ public bool IsPortAuthorized { get; set; }
+
+ /// <summary>
/// Gets or sets the item by name path.
/// </summary>
/// <value>The item by name path.</value>
@@ -144,21 +151,8 @@ namespace MediaBrowser.Model.Configuration
/// <value>The image saving convention.</value>
public ImageSavingConvention ImageSavingConvention { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether [enable people prefix sub folders].
- /// </summary>
- /// <value><c>true</c> if [enable people prefix sub folders]; otherwise, <c>false</c>.</value>
- public bool EnablePeoplePrefixSubFolders { get; set; }
-
- /// <summary>
- /// Gets or sets the encoding quality.
- /// </summary>
- /// <value>The encoding quality.</value>
- public EncodingQuality MediaEncodingQuality { get; set; }
-
public MetadataOptions[] MetadataOptions { get; set; }
- public bool EnableDebugEncodingLogging { get; set; }
public string TranscodingTempPath { get; set; }
public bool EnableAutomaticRestart { get; set; }
@@ -171,16 +165,15 @@ namespace MediaBrowser.Model.Configuration
public string UICulture { get; set; }
- public double DownMixAudioBoost { get; set; }
-
public PeopleMetadataOptions PeopleMetadataOptions { get; set; }
public bool FindInternetTrailers { get; set; }
public string[] InsecureApps7 { get; set; }
public bool SaveMetadataHidden { get; set; }
+ public bool EnableWin8HttpListener { get; set; }
- public bool PlaylistImagesDeleted { get; set; }
+ public NameValuePair[] ContentTypes { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="ServerConfiguration" /> class.
@@ -188,17 +181,15 @@ namespace MediaBrowser.Model.Configuration
public ServerConfiguration()
: base()
{
- MediaEncodingQuality = EncodingQuality.Auto;
ImageSavingConvention = ImageSavingConvention.Compatible;
PublicPort = 8096;
HttpServerPortNumber = 8096;
EnableDashboardResponseCaching = true;
EnableAutomaticRestart = true;
- EnablePeoplePrefixSubFolders = true;
+ EnableWin8HttpListener = true;
EnableUPnP = true;
- DownMixAudioBoost = 2;
MinResumePct = 5;
MaxResumePct = 90;
@@ -212,6 +203,7 @@ namespace MediaBrowser.Model.Configuration
FindInternetTrailers = true;
PathSubstitutions = new PathSubstitution[] { };
+ ContentTypes = new NameValuePair[] { };
PreferredMetadataLanguage = "en";
MetadataCountryCode = "US";
diff --git a/MediaBrowser.Model/Configuration/UserConfiguration.cs b/MediaBrowser.Model/Configuration/UserConfiguration.cs
index f0a27a2b9..9e33c1c36 100644
--- a/MediaBrowser.Model/Configuration/UserConfiguration.cs
+++ b/MediaBrowser.Model/Configuration/UserConfiguration.cs
@@ -42,6 +42,10 @@ namespace MediaBrowser.Model.Configuration
/// <value><c>true</c> if this instance is hidden; otherwise, <c>false</c>.</value>
public bool IsHidden { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is disabled.
+ /// </summary>
+ /// <value><c>true</c> if this instance is disabled; otherwise, <c>false</c>.</value>
public bool IsDisabled { get; set; }
public bool DisplayMissingEpisodes { get; set; }
@@ -74,9 +78,6 @@ namespace MediaBrowser.Model.Configuration
public string[] OrderedViews { get; set; }
- public bool SyncConnectName { get; set; }
- public bool SyncConnectImage { get; set; }
-
public bool IncludeTrailersInSuggestions { get; set; }
public bool EnableCinemaMode { get; set; }
@@ -87,7 +88,9 @@ namespace MediaBrowser.Model.Configuration
public string[] LatestItemsExcludes { get; set; }
public string[] BlockedTags { get; set; }
-
+
+ public bool HasMigratedToPolicy { get; set; }
+
/// <summary>
/// Initializes a new instance of the <see cref="UserConfiguration" /> class.
/// </summary>
@@ -110,8 +113,6 @@ namespace MediaBrowser.Model.Configuration
ExcludeFoldersFromGrouping = new string[] { };
DisplayCollectionsView = true;
- SyncConnectName = true;
- SyncConnectImage = true;
IncludeTrailersInSuggestions = true;
EnableCinemaMode = true;
EnableUserPreferenceAccess = true;
diff --git a/MediaBrowser.Model/Devices/DeviceQuery.cs b/MediaBrowser.Model/Devices/DeviceQuery.cs
index c3b4313f4..2cd2389d8 100644
--- a/MediaBrowser.Model/Devices/DeviceQuery.cs
+++ b/MediaBrowser.Model/Devices/DeviceQuery.cs
@@ -18,5 +18,10 @@ namespace MediaBrowser.Model.Devices
/// </summary>
/// <value><c>null</c> if [supports synchronize] contains no value, <c>true</c> if [supports synchronize]; otherwise, <c>false</c>.</value>
public bool? SupportsSync { get; set; }
+ /// <summary>
+ /// Gets or sets the user identifier.
+ /// </summary>
+ /// <value>The user identifier.</value>
+ public string UserId { get; set; }
}
}
diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs
index 208ea1420..7c47b0d44 100644
--- a/MediaBrowser.Model/Dlna/StreamBuilder.cs
+++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs
@@ -109,7 +109,8 @@ namespace MediaBrowser.Model.Dlna
ItemId = options.ItemId,
MediaType = DlnaProfileType.Audio,
MediaSource = item,
- RunTimeTicks = item.RunTimeTicks
+ RunTimeTicks = item.RunTimeTicks,
+ Context = options.Context
};
int? maxBitrateSetting = options.GetMaxBitrate();
@@ -240,7 +241,8 @@ namespace MediaBrowser.Model.Dlna
ItemId = options.ItemId,
MediaType = DlnaProfileType.Video,
MediaSource = item,
- RunTimeTicks = item.RunTimeTicks
+ RunTimeTicks = item.RunTimeTicks,
+ Context = options.Context
};
int? audioStreamIndex = options.AudioStreamIndex ?? item.DefaultAudioStreamIndex;
diff --git a/MediaBrowser.Model/Dlna/StreamInfo.cs b/MediaBrowser.Model/Dlna/StreamInfo.cs
index 7ca8ab6b0..22eb0cf6c 100644
--- a/MediaBrowser.Model/Dlna/StreamInfo.cs
+++ b/MediaBrowser.Model/Dlna/StreamInfo.cs
@@ -18,6 +18,7 @@ namespace MediaBrowser.Model.Dlna
public string ItemId { get; set; }
public PlayMethod PlayMethod { get; set; }
+ public EncodingContext Context { get; set; }
public DlnaProfileType MediaType { get; set; }
@@ -374,9 +375,17 @@ namespace MediaBrowser.Model.Dlna
MediaStream stream = TargetAudioStream;
int? streamChannels = stream == null ? null : stream.Channels;
- return MaxAudioChannels.HasValue && !IsDirectStream
- ? (streamChannels.HasValue ? Math.Min(MaxAudioChannels.Value, streamChannels.Value) : MaxAudioChannels.Value)
- : streamChannels;
+ if (MaxAudioChannels.HasValue && !IsDirectStream)
+ {
+ if (streamChannels.HasValue)
+ {
+ return Math.Min(MaxAudioChannels.Value, streamChannels.Value);
+ }
+
+ return MaxAudioChannels.Value;
+ }
+
+ return streamChannels;
}
}
diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs
index 71cefa076..2383d4809 100644
--- a/MediaBrowser.Model/Dto/BaseItemDto.cs
+++ b/MediaBrowser.Model/Dto/BaseItemDto.cs
@@ -366,6 +366,11 @@ namespace MediaBrowser.Model.Dto
/// </summary>
/// <value>The user data.</value>
public UserItemDataDto UserData { get; set; }
+ /// <summary>
+ /// Gets or sets the season user data.
+ /// </summary>
+ /// <value>The season user data.</value>
+ public UserItemDataDto SeasonUserData { get; set; }
/// <summary>
/// Gets or sets the recursive item count.
@@ -549,7 +554,13 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets a value indicating whether [supports playlists].
/// </summary>
/// <value><c>true</c> if [supports playlists]; otherwise, <c>false</c>.</value>
- public bool SupportsPlaylists { get; set; }
+ public bool SupportsPlaylists
+ {
+ get
+ {
+ return RunTimeTicks.HasValue || IsFolder || IsGenre || IsMusicGenre || IsArtist;
+ }
+ }
/// <summary>
/// Determines whether the specified type is type.
diff --git a/MediaBrowser.Model/Dto/DtoOptions.cs b/MediaBrowser.Model/Dto/DtoOptions.cs
deleted file mode 100644
index 069d71fce..000000000
--- a/MediaBrowser.Model/Dto/DtoOptions.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.Querying;
-using System.Collections.Generic;
-
-namespace MediaBrowser.Model.Dto
-{
- public class DtoOptions
- {
- public List<ItemFields> Fields { get; set; }
- public List<ImageType> ImageTypes { get; set; }
- public int ImageTypeLimit { get; set; }
- public bool EnableImages { get; set; }
-
- public DtoOptions()
- {
- Fields = new List<ItemFields>();
- ImageTypes = new List<ImageType>();
- ImageTypeLimit = int.MaxValue;
- EnableImages = true;
- }
-
- public int GetImageLimit(ImageType type)
- {
- if (EnableImages && ImageTypes.Contains(type))
- {
- return ImageTypeLimit;
- }
-
- return 0;
- }
- }
-}
diff --git a/MediaBrowser.Model/Dto/MetadataEditorInfo.cs b/MediaBrowser.Model/Dto/MetadataEditorInfo.cs
new file mode 100644
index 000000000..9bd15fc8f
--- /dev/null
+++ b/MediaBrowser.Model/Dto/MetadataEditorInfo.cs
@@ -0,0 +1,27 @@
+using MediaBrowser.Model.Entities;
+using MediaBrowser.Model.Globalization;
+using MediaBrowser.Model.Providers;
+using System.Collections.Generic;
+
+namespace MediaBrowser.Model.Dto
+{
+ public class MetadataEditorInfo
+ {
+ public List<ParentalRating> ParentalRatingOptions { get; set; }
+ public List<CountryInfo> Countries { get; set; }
+ public List<CultureDto> Cultures { get; set; }
+ public List<ExternalIdInfo> ExternalIdInfos { get; set; }
+
+ public string ContentType { get; set; }
+ public List<NameValuePair> ContentTypeOptions { get; set; }
+
+ public MetadataEditorInfo()
+ {
+ ParentalRatingOptions = new List<ParentalRating>();
+ Countries = new List<CountryInfo>();
+ Cultures = new List<CultureDto>();
+ ExternalIdInfos = new List<ExternalIdInfo>();
+ ContentTypeOptions = new List<NameValuePair>();
+ }
+ }
+}
diff --git a/MediaBrowser.Model/Dto/NameValuePair.cs b/MediaBrowser.Model/Dto/NameValuePair.cs
new file mode 100644
index 000000000..2d55e8f2a
--- /dev/null
+++ b/MediaBrowser.Model/Dto/NameValuePair.cs
@@ -0,0 +1,17 @@
+
+namespace MediaBrowser.Model.Dto
+{
+ public class NameValuePair
+ {
+ /// <summary>
+ /// Gets or sets the name.
+ /// </summary>
+ /// <value>The name.</value>
+ public string Name { get; set; }
+ /// <summary>
+ /// Gets or sets the value.
+ /// </summary>
+ /// <value>The value.</value>
+ public string Value { get; set; }
+ }
+}
diff --git a/MediaBrowser.Model/Dto/StreamOptions.cs b/MediaBrowser.Model/Dto/StreamOptions.cs
deleted file mode 100644
index 5b7cdc6fb..000000000
--- a/MediaBrowser.Model/Dto/StreamOptions.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-using System;
-
-namespace MediaBrowser.Model.Dto
-{
- /// <summary>
- /// Class StreamOptions
- /// </summary>
- [Obsolete]
- public class StreamOptions
- {
- /// <summary>
- /// Gets or sets the audio bit rate.
- /// </summary>
- /// <value>The audio bit rate.</value>
- public int? AudioBitRate { get; set; }
-
- /// <summary>
- /// Gets or sets the audio codec.
- /// Omit to copy the original stream
- /// </summary>
- /// <value>The audio encoding format.</value>
- public string AudioCodec { get; set; }
-
- /// <summary>
- /// Gets or sets the item id.
- /// </summary>
- /// <value>The item id.</value>
- public string ItemId { get; set; }
-
- /// <summary>
- /// Gets or sets the max audio channels.
- /// </summary>
- /// <value>The max audio channels.</value>
- public int? MaxAudioChannels { get; set; }
-
- /// <summary>
- /// Gets or sets the max audio sample rate.
- /// </summary>
- /// <value>The max audio sample rate.</value>
- public int? MaxAudioSampleRate { get; set; }
-
- /// <summary>
- /// Gets or sets the start time ticks.
- /// </summary>
- /// <value>The start time ticks.</value>
- public long? StartTimeTicks { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the original media should be served statically
- /// Only used with progressive streaming
- /// </summary>
- /// <value><c>true</c> if static; otherwise, <c>false</c>.</value>
- public bool? Static { get; set; }
-
- /// <summary>
- /// Gets or sets the output file extension.
- /// </summary>
- /// <value>The output file extension.</value>
- public string OutputFileExtension { get; set; }
-
- /// <summary>
- /// Gets or sets the device id.
- /// </summary>
- /// <value>The device id.</value>
- public string DeviceId { get; set; }
- }
-}
diff --git a/MediaBrowser.Model/Dto/VideoStreamOptions.cs b/MediaBrowser.Model/Dto/VideoStreamOptions.cs
index 606e928f2..e9a83bd12 100644
--- a/MediaBrowser.Model/Dto/VideoStreamOptions.cs
+++ b/MediaBrowser.Model/Dto/VideoStreamOptions.cs
@@ -6,9 +6,65 @@ namespace MediaBrowser.Model.Dto
/// Class VideoStreamOptions
/// </summary>
[Obsolete]
- public class VideoStreamOptions : StreamOptions
+ public class VideoStreamOptions
{
/// <summary>
+ /// Gets or sets the audio bit rate.
+ /// </summary>
+ /// <value>The audio bit rate.</value>
+ public int? AudioBitRate { get; set; }
+
+ /// <summary>
+ /// Gets or sets the audio codec.
+ /// Omit to copy the original stream
+ /// </summary>
+ /// <value>The audio encoding format.</value>
+ public string AudioCodec { get; set; }
+
+ /// <summary>
+ /// Gets or sets the item id.
+ /// </summary>
+ /// <value>The item id.</value>
+ public string ItemId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the max audio channels.
+ /// </summary>
+ /// <value>The max audio channels.</value>
+ public int? MaxAudioChannels { get; set; }
+
+ /// <summary>
+ /// Gets or sets the max audio sample rate.
+ /// </summary>
+ /// <value>The max audio sample rate.</value>
+ public int? MaxAudioSampleRate { get; set; }
+
+ /// <summary>
+ /// Gets or sets the start time ticks.
+ /// </summary>
+ /// <value>The start time ticks.</value>
+ public long? StartTimeTicks { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the original media should be served statically
+ /// Only used with progressive streaming
+ /// </summary>
+ /// <value><c>true</c> if static; otherwise, <c>false</c>.</value>
+ public bool? Static { get; set; }
+
+ /// <summary>
+ /// Gets or sets the output file extension.
+ /// </summary>
+ /// <value>The output file extension.</value>
+ public string OutputFileExtension { get; set; }
+
+ /// <summary>
+ /// Gets or sets the device id.
+ /// </summary>
+ /// <value>The device id.</value>
+ public string DeviceId { get; set; }
+
+ /// <summary>
/// Gets or sets the video codec.
/// Omit to copy
/// </summary>
diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj
index b81b4c1fd..2a1b0b659 100644
--- a/MediaBrowser.Model/MediaBrowser.Model.csproj
+++ b/MediaBrowser.Model/MediaBrowser.Model.csproj
@@ -96,6 +96,7 @@
<Compile Include="Configuration\ChannelOptions.cs" />
<Compile Include="Configuration\ChapterOptions.cs" />
<Compile Include="Configuration\CinemaModeConfiguration.cs" />
+ <Compile Include="Configuration\EncodingOptions.cs" />
<Compile Include="Configuration\MetadataConfiguration.cs" />
<Compile Include="Configuration\PeopleMetadataOptions.cs" />
<Compile Include="Configuration\XbmcMetadataOptions.cs" />
@@ -126,11 +127,11 @@
<Compile Include="Dlna\SubtitleDeliveryMethod.cs" />
<Compile Include="Dlna\SubtitleStreamInfo.cs" />
<Compile Include="Drawing\ImageOrientation.cs" />
- <Compile Include="Dto\DtoOptions.cs" />
<Compile Include="Dto\IHasServerId.cs" />
+ <Compile Include="Dto\MetadataEditorInfo.cs" />
+ <Compile Include="Dto\NameValuePair.cs" />
<Compile Include="MediaInfo\LiveMediaInfoResult.cs" />
<Compile Include="Dto\MediaSourceType.cs" />
- <Compile Include="Dto\StreamOptions.cs" />
<Compile Include="Dto\VideoStreamOptions.cs" />
<Compile Include="Configuration\DynamicDayOfWeek.cs" />
<Compile Include="Entities\ExtraType.cs" />
@@ -152,6 +153,8 @@
<Compile Include="Configuration\MetadataPluginType.cs" />
<Compile Include="Dlna\SubtitleProfile.cs" />
<Compile Include="MediaInfo\MediaProtocol.cs" />
+ <Compile Include="Net\HttpResponse.cs" />
+ <Compile Include="Net\MimeTypes.cs" />
<Compile Include="Notifications\NotificationOption.cs" />
<Compile Include="Notifications\NotificationOptions.cs" />
<Compile Include="Notifications\NotificationType.cs" />
@@ -363,8 +366,15 @@
<Compile Include="Session\TranscodingInfo.cs" />
<Compile Include="Session\UserDataChangeInfo.cs" />
<Compile Include="Devices\ContentUploadHistory.cs" />
+ <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\SyncDataRequest.cs" />
+ <Compile Include="Sync\SyncDataResponse.cs" />
<Compile Include="Sync\SyncDialogOptions.cs" />
+ <Compile Include="Sync\SyncedItem.cs" />
<Compile Include="Sync\SyncHelper.cs" />
<Compile Include="Sync\SyncJob.cs" />
<Compile Include="Sync\SyncJobCreationResult.cs" />
@@ -419,6 +429,8 @@
<Compile Include="Users\ForgotPasswordAction.cs" />
<Compile Include="Users\ForgotPasswordResult.cs" />
<Compile Include="Users\PinRedeemResult.cs" />
+ <Compile Include="Users\UserAction.cs" />
+ <Compile Include="Users\UserActionType.cs" />
<Compile Include="Users\UserPolicy.cs" />
<None Include="Fody.targets" />
<None Include="FodyWeavers.xml" />
diff --git a/MediaBrowser.Model/Net/HttpResponse.cs b/MediaBrowser.Model/Net/HttpResponse.cs
new file mode 100644
index 000000000..f4bd8e681
--- /dev/null
+++ b/MediaBrowser.Model/Net/HttpResponse.cs
@@ -0,0 +1,64 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Net;
+
+namespace MediaBrowser.Model.Net
+{
+ public class HttpResponse : IDisposable
+ {
+ /// <summary>
+ /// Gets or sets the type of the content.
+ /// </summary>
+ /// <value>The type of the content.</value>
+ public string ContentType { get; set; }
+
+ /// <summary>
+ /// Gets or sets the response URL.
+ /// </summary>
+ /// <value>The response URL.</value>
+ public string ResponseUrl { get; set; }
+
+ /// <summary>
+ /// Gets or sets the content.
+ /// </summary>
+ /// <value>The content.</value>
+ public Stream Content { get; set; }
+
+ /// <summary>
+ /// Gets or sets the status code.
+ /// </summary>
+ /// <value>The status code.</value>
+ public HttpStatusCode StatusCode { get; set; }
+
+ /// <summary>
+ /// Gets or sets the length of the content.
+ /// </summary>
+ /// <value>The length of the content.</value>
+ public long? ContentLength { get; set; }
+
+ /// <summary>
+ /// Gets or sets the headers.
+ /// </summary>
+ /// <value>The headers.</value>
+ public Dictionary<string, string> Headers { get; set; }
+
+ private readonly IDisposable _disposable;
+
+ public HttpResponse(IDisposable disposable)
+ {
+ _disposable = disposable;
+ }
+ public HttpResponse()
+ {
+ }
+
+ public void Dispose()
+ {
+ if (_disposable != null)
+ {
+ _disposable.Dispose();
+ }
+ }
+ }
+}
diff --git a/MediaBrowser.Model/Net/MimeTypes.cs b/MediaBrowser.Model/Net/MimeTypes.cs
new file mode 100644
index 000000000..1f54e48d1
--- /dev/null
+++ b/MediaBrowser.Model/Net/MimeTypes.cs
@@ -0,0 +1,291 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+
+namespace MediaBrowser.Model.Net
+{
+ /// <summary>
+ /// Class MimeTypes
+ /// </summary>
+ public static class MimeTypes
+ {
+ /// <summary>
+ /// Any extension in this list is considered a video file - can be added to at runtime for extensibility
+ /// </summary>
+ private static readonly List<string> VideoFileExtensions = new List<string>
+ {
+ ".mkv",
+ ".m2t",
+ ".m2ts",
+ ".img",
+ ".iso",
+ ".mk3d",
+ ".ts",
+ ".rmvb",
+ ".mov",
+ ".avi",
+ ".mpg",
+ ".mpeg",
+ ".wmv",
+ ".mp4",
+ ".divx",
+ ".dvr-ms",
+ ".wtv",
+ ".ogm",
+ ".ogv",
+ ".asf",
+ ".m4v",
+ ".flv",
+ ".f4v",
+ ".3gp",
+ ".webm",
+ ".mts",
+ ".m2v",
+ ".rec"
+ };
+
+ private static readonly Dictionary<string, string> VideoFileExtensionsDictionary = VideoFileExtensions.ToDictionary(i => i, StringComparer.OrdinalIgnoreCase);
+
+ // http://en.wikipedia.org/wiki/Internet_media_type
+ // Add more as needed
+
+ private static readonly Dictionary<string, string> MimeTypeLookup =
+ new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
+ {
+ {".jpg", "image/jpeg"},
+ {".jpeg", "image/jpeg"},
+ {".tbn", "image/jpeg"},
+ {".png", "image/png"},
+ {".gif", "image/gif"},
+ {".webp", "image/webp"},
+ {".ico", "image/vnd.microsoft.icon"},
+ {".mpg", "video/mpeg"},
+ {".mpeg", "video/mpeg"},
+ {".ogv", "video/ogg"},
+ {".mov", "video/quicktime"},
+ {".webm", "video/webm"},
+ {".mkv", "video/x-matroska"},
+ {".wmv", "video/x-ms-wmv"},
+ {".flv", "video/x-flv"},
+ {".avi", "video/x-msvideo"},
+ {".asf", "video/x-ms-asf"},
+ {".m4v", "video/x-m4v"}
+ };
+
+ private static readonly Dictionary<string, string> ExtensionLookup = CreateExtensionLookup();
+
+ private static Dictionary<string, string> CreateExtensionLookup()
+ {
+ var dict = MimeTypeLookup
+ .GroupBy(i => i.Value)
+ .ToDictionary(x => x.Key, x => x.First().Key, StringComparer.OrdinalIgnoreCase);
+
+ dict["image/jpg"] = ".jpg";
+
+ return dict;
+ }
+
+ /// <summary>
+ /// Gets the type of the MIME.
+ /// </summary>
+ /// <param name="path">The path.</param>
+ /// <returns>System.String.</returns>
+ /// <exception cref="ArgumentNullException">path</exception>
+ /// <exception cref="InvalidOperationException">Argument not supported: + path</exception>
+ public static string GetMimeType(string path)
+ {
+ if (string.IsNullOrEmpty(path))
+ {
+ throw new ArgumentNullException("path");
+ }
+
+ var ext = Path.GetExtension(path) ?? string.Empty;
+
+ string result;
+ if (MimeTypeLookup.TryGetValue(ext, out result))
+ {
+ return result;
+ }
+
+ // Type video
+ if (ext.Equals(".3gp", StringComparison.OrdinalIgnoreCase))
+ {
+ return "video/3gpp";
+ }
+ if (ext.Equals(".3g2", StringComparison.OrdinalIgnoreCase))
+ {
+ return "video/3gpp2";
+ }
+ if (ext.Equals(".ts", StringComparison.OrdinalIgnoreCase))
+ {
+ return "video/mp2t";
+ }
+ if (ext.Equals(".mpd", StringComparison.OrdinalIgnoreCase))
+ {
+ return "video/vnd.mpeg.dash.mpd";
+ }
+
+ // Catch-all for all video types that don't require specific mime types
+ if (VideoFileExtensionsDictionary.ContainsKey(ext))
+ {
+ return "video/" + ext.TrimStart('.').ToLower();
+ }
+
+ // Type text
+ if (ext.Equals(".css", StringComparison.OrdinalIgnoreCase))
+ {
+ return "text/css";
+ }
+ if (ext.Equals(".csv", StringComparison.OrdinalIgnoreCase))
+ {
+ return "text/csv";
+ }
+ if (ext.Equals(".html", StringComparison.OrdinalIgnoreCase) || ext.Equals(".htm", StringComparison.OrdinalIgnoreCase))
+ {
+ return "text/html; charset=UTF-8";
+ }
+ if (ext.Equals(".txt", StringComparison.OrdinalIgnoreCase))
+ {
+ return "text/plain";
+ }
+ if (ext.Equals(".xml", StringComparison.OrdinalIgnoreCase))
+ {
+ return "application/xml";
+ }
+
+ // Type document
+ if (ext.Equals(".pdf", StringComparison.OrdinalIgnoreCase))
+ {
+ return "application/pdf";
+ }
+ if (ext.Equals(".mobi", StringComparison.OrdinalIgnoreCase))
+ {
+ return "application/x-mobipocket-ebook";
+ }
+ if (ext.Equals(".epub", StringComparison.OrdinalIgnoreCase))
+ {
+ return "application/epub+zip";
+ }
+ if (ext.Equals(".cbz", StringComparison.OrdinalIgnoreCase) || ext.Equals(".cbr", StringComparison.OrdinalIgnoreCase))
+ {
+ return "application/x-cdisplay";
+ }
+
+ // Type audio
+ if (ext.Equals(".mp3", StringComparison.OrdinalIgnoreCase))
+ {
+ return "audio/mpeg";
+ }
+ if (ext.Equals(".m4a", StringComparison.OrdinalIgnoreCase) || ext.Equals(".aac", StringComparison.OrdinalIgnoreCase))
+ {
+ return "audio/mp4";
+ }
+ if (ext.Equals(".webma", StringComparison.OrdinalIgnoreCase))
+ {
+ return "audio/webm";
+ }
+ if (ext.Equals(".wav", StringComparison.OrdinalIgnoreCase))
+ {
+ return "audio/wav";
+ }
+ if (ext.Equals(".wma", StringComparison.OrdinalIgnoreCase))
+ {
+ return "audio/x-ms-wma";
+ }
+ if (ext.Equals(".flac", StringComparison.OrdinalIgnoreCase))
+ {
+ return "audio/flac";
+ }
+ if (ext.Equals(".aac", StringComparison.OrdinalIgnoreCase))
+ {
+ return "audio/x-aac";
+ }
+ if (ext.Equals(".ogg", StringComparison.OrdinalIgnoreCase) || ext.Equals(".oga", StringComparison.OrdinalIgnoreCase))
+ {
+ return "audio/ogg";
+ }
+
+ // Playlists
+ if (ext.Equals(".m3u8", StringComparison.OrdinalIgnoreCase))
+ {
+ return "application/x-mpegURL";
+ }
+
+ // Misc
+ if (ext.Equals(".dll", StringComparison.OrdinalIgnoreCase))
+ {
+ return "application/octet-stream";
+ }
+
+ // Web
+ if (ext.Equals(".js", StringComparison.OrdinalIgnoreCase))
+ {
+ return "application/x-javascript";
+ }
+ if (ext.Equals(".json", StringComparison.OrdinalIgnoreCase))
+ {
+ return "application/json";
+ }
+ if (ext.Equals(".map", StringComparison.OrdinalIgnoreCase))
+ {
+ return "application/x-javascript";
+ }
+
+ if (ext.Equals(".woff", StringComparison.OrdinalIgnoreCase))
+ {
+ return "font/woff";
+ }
+
+ if (ext.Equals(".ttf", StringComparison.OrdinalIgnoreCase))
+ {
+ return "font/ttf";
+ }
+ if (ext.Equals(".eot", StringComparison.OrdinalIgnoreCase))
+ {
+ return "application/vnd.ms-fontobject";
+ }
+ if (ext.Equals(".svg", StringComparison.OrdinalIgnoreCase) || ext.Equals(".svgz", StringComparison.OrdinalIgnoreCase))
+ {
+ return "image/svg+xml";
+ }
+
+ if (ext.Equals(".srt", StringComparison.OrdinalIgnoreCase))
+ {
+ return "text/plain";
+ }
+
+ if (ext.Equals(".vtt", StringComparison.OrdinalIgnoreCase))
+ {
+ return "text/vtt";
+ }
+
+ if (ext.Equals(".ttml", StringComparison.OrdinalIgnoreCase))
+ {
+ return "application/ttml+xml";
+ }
+
+ if (ext.Equals(".bif", StringComparison.OrdinalIgnoreCase))
+ {
+ return "application/octet-stream";
+ }
+
+ throw new ArgumentException("Argument not supported: " + path);
+ }
+
+ public static string ToExtension(string 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);
+ }
+ }
+}
diff --git a/MediaBrowser.Model/Querying/ItemFields.cs b/MediaBrowser.Model/Querying/ItemFields.cs
index 19e30cd8a..5018f8e51 100644
--- a/MediaBrowser.Model/Querying/ItemFields.cs
+++ b/MediaBrowser.Model/Querying/ItemFields.cs
@@ -7,6 +7,11 @@ namespace MediaBrowser.Model.Querying
public enum ItemFields
{
/// <summary>
+ /// The air time
+ /// </summary>
+ AirTime,
+
+ /// <summary>
/// The alternate episode numbers
/// </summary>
AlternateEpisodeNumbers,
@@ -102,11 +107,6 @@ namespace MediaBrowser.Model.Querying
Metascore,
/// <summary>
- /// The metadata settings
- /// </summary>
- Settings,
-
- /// <summary>
/// The item overview
/// </summary>
Overview,
@@ -152,6 +152,16 @@ namespace MediaBrowser.Model.Querying
Revenue,
/// <summary>
+ /// The season name
+ /// </summary>
+ SeasonName,
+
+ /// <summary>
+ /// The settings
+ /// </summary>
+ Settings,
+
+ /// <summary>
/// The short overview
/// </summary>
ShortOverview,
@@ -182,6 +192,11 @@ namespace MediaBrowser.Model.Querying
SortName,
/// <summary>
+ /// The special episode numbers
+ /// </summary>
+ SpecialEpisodeNumbers,
+
+ /// <summary>
/// The studios of the item
/// </summary>
Studios,
@@ -219,6 +234,11 @@ namespace MediaBrowser.Model.Querying
/// <summary>
/// The media streams
/// </summary>
- MediaStreams
+ MediaStreams,
+
+ /// <summary>
+ /// The season user data
+ /// </summary>
+ SeasonUserData
}
}
diff --git a/MediaBrowser.Model/Session/TranscodingInfo.cs b/MediaBrowser.Model/Session/TranscodingInfo.cs
index b3ab32a44..e646d80d3 100644
--- a/MediaBrowser.Model/Session/TranscodingInfo.cs
+++ b/MediaBrowser.Model/Session/TranscodingInfo.cs
@@ -5,6 +5,8 @@ namespace MediaBrowser.Model.Session
public string AudioCodec { get; set; }
public string VideoCodec { get; set; }
public string Container { get; set; }
+ public bool IsVideoDirect { get; set; }
+ public bool IsAudioDirect { get; set; }
public int? Bitrate { get; set; }
public float? Framerate { get; set; }
diff --git a/MediaBrowser.Model/Sync/DeviceFileInfo.cs b/MediaBrowser.Model/Sync/DeviceFileInfo.cs
new file mode 100644
index 000000000..bc93b69bc
--- /dev/null
+++ b/MediaBrowser.Model/Sync/DeviceFileInfo.cs
@@ -0,0 +1,9 @@
+
+namespace MediaBrowser.Model.Sync
+{
+ public class DeviceFileInfo
+ {
+ public string Path { get; set; }
+ public string Name { get; set; }
+ }
+}
diff --git a/MediaBrowser.Model/Sync/ItemFIleInfo.cs b/MediaBrowser.Model/Sync/ItemFIleInfo.cs
new file mode 100644
index 000000000..b110af6b5
--- /dev/null
+++ b/MediaBrowser.Model/Sync/ItemFIleInfo.cs
@@ -0,0 +1,28 @@
+using MediaBrowser.Model.Entities;
+
+namespace MediaBrowser.Model.Sync
+{
+ public class ItemFileInfo
+ {
+ /// <summary>
+ /// Gets or sets the type.
+ /// </summary>
+ /// <value>The type.</value>
+ public ItemFileType Type { get; set; }
+ /// <summary>
+ /// Gets or sets the name.
+ /// </summary>
+ /// <value>The name.</value>
+ public string Name { get; set; }
+ /// <summary>
+ /// Gets or sets the path.
+ /// </summary>
+ /// <value>The path.</value>
+ public string Path { get; set; }
+ /// <summary>
+ /// Gets or sets the type of the image.
+ /// </summary>
+ /// <value>The type of the image.</value>
+ public ImageType ImageType { get; set; }
+ }
+}
diff --git a/MediaBrowser.Model/Sync/ItemFileType.cs b/MediaBrowser.Model/Sync/ItemFileType.cs
new file mode 100644
index 000000000..305f4c502
--- /dev/null
+++ b/MediaBrowser.Model/Sync/ItemFileType.cs
@@ -0,0 +1,19 @@
+
+namespace MediaBrowser.Model.Sync
+{
+ public enum ItemFileType
+ {
+ /// <summary>
+ /// The media
+ /// </summary>
+ Media = 0,
+ /// <summary>
+ /// The image
+ /// </summary>
+ Image = 1,
+ /// <summary>
+ /// The subtitles
+ /// </summary>
+ Subtitles = 2
+ }
+}
diff --git a/MediaBrowser.Model/Sync/LocalItem.cs b/MediaBrowser.Model/Sync/LocalItem.cs
new file mode 100644
index 000000000..ec4544524
--- /dev/null
+++ b/MediaBrowser.Model/Sync/LocalItem.cs
@@ -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 Id { get; set; }
+ /// <summary>
+ /// Gets or sets the item identifier.
+ /// </summary>
+ /// <value>The item identifier.</value>
+ public string ItemId { get; set; }
+ }
+}
diff --git a/MediaBrowser.Model/Sync/SyncDataRequest.cs b/MediaBrowser.Model/Sync/SyncDataRequest.cs
new file mode 100644
index 000000000..3eb447b3f
--- /dev/null
+++ b/MediaBrowser.Model/Sync/SyncDataRequest.cs
@@ -0,0 +1,16 @@
+using System.Collections.Generic;
+
+namespace MediaBrowser.Model.Sync
+{
+ public class SyncDataRequest
+ {
+ public List<string> LocalItemIds { get; set; }
+
+ public string TargetId { get; set; }
+
+ public SyncDataRequest()
+ {
+ LocalItemIds = new List<string>();
+ }
+ }
+}
diff --git a/MediaBrowser.Model/Sync/SyncDataResponse.cs b/MediaBrowser.Model/Sync/SyncDataResponse.cs
new file mode 100644
index 000000000..ac7ff5c84
--- /dev/null
+++ b/MediaBrowser.Model/Sync/SyncDataResponse.cs
@@ -0,0 +1,14 @@
+using System.Collections.Generic;
+
+namespace MediaBrowser.Model.Sync
+{
+ public class SyncDataResponse
+ {
+ public List<string> ItemIdsToRemove { get; set; }
+
+ public SyncDataResponse()
+ {
+ ItemIdsToRemove = new List<string>();
+ }
+ }
+}
diff --git a/MediaBrowser.Model/Sync/SyncHelper.cs b/MediaBrowser.Model/Sync/SyncHelper.cs
index 28a36ed21..c2a446fbe 100644
--- a/MediaBrowser.Model/Sync/SyncHelper.cs
+++ b/MediaBrowser.Model/Sync/SyncHelper.cs
@@ -62,6 +62,7 @@ namespace MediaBrowser.Model.Sync
{
List<SyncOptions> options = new List<SyncOptions>();
+ options.Add(SyncOptions.Name);
options.Add(SyncOptions.Quality);
options.Add(SyncOptions.UnwatchedOnly);
options.Add(SyncOptions.SyncNewContent);
diff --git a/MediaBrowser.Model/Sync/SyncJob.cs b/MediaBrowser.Model/Sync/SyncJob.cs
index 92662d7bb..24680d172 100644
--- a/MediaBrowser.Model/Sync/SyncJob.cs
+++ b/MediaBrowser.Model/Sync/SyncJob.cs
@@ -89,7 +89,6 @@ namespace MediaBrowser.Model.Sync
public string ParentName { get; set; }
public string PrimaryImageItemId { get; set; }
public string PrimaryImageTag { get; set; }
- public double? PrimaryImageAspectRatio { get; set; }
public SyncJob()
{
diff --git a/MediaBrowser.Model/Sync/SyncJobItem.cs b/MediaBrowser.Model/Sync/SyncJobItem.cs
index 063f7feb2..4090d82b0 100644
--- a/MediaBrowser.Model/Sync/SyncJobItem.cs
+++ b/MediaBrowser.Model/Sync/SyncJobItem.cs
@@ -23,6 +23,18 @@ namespace MediaBrowser.Model.Sync
public string ItemId { get; set; }
/// <summary>
+ /// Gets or sets the name of the item.
+ /// </summary>
+ /// <value>The name of the item.</value>
+ public string ItemName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the media source identifier.
+ /// </summary>
+ /// <value>The media source identifier.</value>
+ public string MediaSourceId { get; set; }
+
+ /// <summary>
/// Gets or sets the target identifier.
/// </summary>
/// <value>The target identifier.</value>
@@ -51,5 +63,15 @@ namespace MediaBrowser.Model.Sync
/// </summary>
/// <value>The date created.</value>
public DateTime DateCreated { get; set; }
+ /// <summary>
+ /// Gets or sets the primary image item identifier.
+ /// </summary>
+ /// <value>The primary image item identifier.</value>
+ public string PrimaryImageItemId { get; set; }
+ /// <summary>
+ /// Gets or sets the primary image tag.
+ /// </summary>
+ /// <value>The primary image tag.</value>
+ public string PrimaryImageTag { get; set; }
}
}
diff --git a/MediaBrowser.Model/Sync/SyncJobItemQuery.cs b/MediaBrowser.Model/Sync/SyncJobItemQuery.cs
index b85c21691..d21138204 100644
--- a/MediaBrowser.Model/Sync/SyncJobItemQuery.cs
+++ b/MediaBrowser.Model/Sync/SyncJobItemQuery.cs
@@ -1,4 +1,5 @@
-
+using System.Collections.Generic;
+
namespace MediaBrowser.Model.Sync
{
public class SyncJobItemQuery
@@ -27,11 +28,16 @@ namespace MediaBrowser.Model.Sync
/// Gets or sets the status.
/// </summary>
/// <value>The status.</value>
- public SyncJobItemStatus? Status { get; set; }
+ public List<SyncJobItemStatus> Statuses { get; set; }
/// <summary>
- /// Gets or sets a value indicating whether this instance is completed.
+ /// Gets or sets a value indicating whether [add metadata].
/// </summary>
- /// <value><c>null</c> if [is completed] contains no value, <c>true</c> if [is completed]; otherwise, <c>false</c>.</value>
- public bool? IsCompleted { get; set; }
+ /// <value><c>true</c> if [add metadata]; otherwise, <c>false</c>.</value>
+ public bool AddMetadata { get; set; }
+
+ public SyncJobItemQuery()
+ {
+ Statuses = new List<SyncJobItemStatus>();
+ }
}
}
diff --git a/MediaBrowser.Model/Sync/SyncJobItemStatus.cs b/MediaBrowser.Model/Sync/SyncJobItemStatus.cs
index 3d0579a3c..913f9e259 100644
--- a/MediaBrowser.Model/Sync/SyncJobItemStatus.cs
+++ b/MediaBrowser.Model/Sync/SyncJobItemStatus.cs
@@ -6,7 +6,9 @@ namespace MediaBrowser.Model.Sync
Queued = 0,
Converting = 1,
Transferring = 2,
- Completed = 3,
- Failed = 4
+ Synced = 3,
+ RemovedFromDevice = 4,
+ Failed = 5,
+ Cancelled = 6
}
}
diff --git a/MediaBrowser.Model/Sync/SyncJobQuery.cs b/MediaBrowser.Model/Sync/SyncJobQuery.cs
index 2af06bcfa..35f0e076d 100644
--- a/MediaBrowser.Model/Sync/SyncJobQuery.cs
+++ b/MediaBrowser.Model/Sync/SyncJobQuery.cs
@@ -23,5 +23,10 @@ namespace MediaBrowser.Model.Sync
/// </summary>
/// <value>The target identifier.</value>
public string TargetId { get; set; }
+ /// <summary>
+ /// Gets or sets the user identifier.
+ /// </summary>
+ /// <value>The user identifier.</value>
+ public string UserId { get; set; }
}
}
diff --git a/MediaBrowser.Model/Sync/SyncQuality.cs b/MediaBrowser.Model/Sync/SyncQuality.cs
index f915e2768..d34ad22c2 100644
--- a/MediaBrowser.Model/Sync/SyncQuality.cs
+++ b/MediaBrowser.Model/Sync/SyncQuality.cs
@@ -6,16 +6,16 @@ namespace MediaBrowser.Model.Sync
/// <summary>
/// The good
/// </summary>
- Good = 0,
+ Low = 0,
/// <summary>
/// The better
/// </summary>
- Better = 1,
+ Medium = 1,
/// <summary>
/// The best
/// </summary>
- Best = 2
+ High = 2
}
}
diff --git a/MediaBrowser.Model/Sync/SyncedItem.cs b/MediaBrowser.Model/Sync/SyncedItem.cs
new file mode 100644
index 000000000..784a12bc9
--- /dev/null
+++ b/MediaBrowser.Model/Sync/SyncedItem.cs
@@ -0,0 +1,38 @@
+using MediaBrowser.Model.Dto;
+
+namespace MediaBrowser.Model.Sync
+{
+ public class SyncedItem
+ {
+ /// <summary>
+ /// Gets or sets the server identifier.
+ /// </summary>
+ /// <value>The server identifier.</value>
+ public string ServerId { get; set; }
+ /// <summary>
+ /// Gets or sets the synchronize job identifier.
+ /// </summary>
+ /// <value>The synchronize job identifier.</value>
+ public string SyncJobId { get; set; }
+ /// <summary>
+ /// Gets or sets the synchronize job item identifier.
+ /// </summary>
+ /// <value>The synchronize job item identifier.</value>
+ public string SyncJobItemId { get; set; }
+ /// <summary>
+ /// Gets or sets the name of the original file.
+ /// </summary>
+ /// <value>The name of the original file.</value>
+ public string OriginalFileName { get; set; }
+ /// <summary>
+ /// Gets or sets the item.
+ /// </summary>
+ /// <value>The item.</value>
+ public BaseItemDto Item { get; set; }
+ /// <summary>
+ /// Gets or sets the user identifier.
+ /// </summary>
+ /// <value>The user identifier.</value>
+ public string UserId { get; set; }
+ }
+}
diff --git a/MediaBrowser.Model/Users/UserAction.cs b/MediaBrowser.Model/Users/UserAction.cs
new file mode 100644
index 000000000..680835364
--- /dev/null
+++ b/MediaBrowser.Model/Users/UserAction.cs
@@ -0,0 +1,15 @@
+using System;
+
+namespace MediaBrowser.Model.Users
+{
+ public class UserAction
+ {
+ public string Id { get; set; }
+ public string ServerId { get; set; }
+ public string UserId { get; set; }
+ public string ItemId { get; set; }
+ public UserActionType Type { get; set; }
+ public DateTime Date { get; set; }
+ public long? PositionTicks { get; set; }
+ }
+}
diff --git a/MediaBrowser.Model/Users/UserActionType.cs b/MediaBrowser.Model/Users/UserActionType.cs
new file mode 100644
index 000000000..493de6272
--- /dev/null
+++ b/MediaBrowser.Model/Users/UserActionType.cs
@@ -0,0 +1,8 @@
+
+namespace MediaBrowser.Model.Users
+{
+ public enum UserActionType
+ {
+ PlayedItem = 0
+ }
+}
diff --git a/MediaBrowser.Model/Users/UserPolicy.cs b/MediaBrowser.Model/Users/UserPolicy.cs
index b458e2854..0a6a37696 100644
--- a/MediaBrowser.Model/Users/UserPolicy.cs
+++ b/MediaBrowser.Model/Users/UserPolicy.cs
@@ -1,8 +1,75 @@
-
+using MediaBrowser.Model.Configuration;
+
namespace MediaBrowser.Model.Users
{
public class UserPolicy
{
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is administrator.
+ /// </summary>
+ /// <value><c>true</c> if this instance is administrator; otherwise, <c>false</c>.</value>
+ public bool IsAdministrator { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is hidden.
+ /// </summary>
+ /// <value><c>true</c> if this instance is hidden; otherwise, <c>false</c>.</value>
+ public bool IsHidden { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is disabled.
+ /// </summary>
+ /// <value><c>true</c> if this instance is disabled; otherwise, <c>false</c>.</value>
+ public bool IsDisabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets the max parental rating.
+ /// </summary>
+ /// <value>The max parental rating.</value>
+ public int? MaxParentalRating { get; set; }
+
+ public string[] BlockedTags { get; set; }
+ public bool EnableUserPreferenceAccess { get; set; }
+ public AccessSchedule[] AccessSchedules { get; set; }
+ public UnratedItem[] BlockUnratedItems { get; set; }
+ public string[] BlockedMediaFolders { get; set; }
+ public string[] BlockedChannels { get; set; }
+ public bool EnableRemoteControlOfOtherUsers { get; set; }
+ public bool EnableSharedDeviceControl { get; set; }
+
+ public bool EnableLiveTvManagement { get; set; }
+ public bool EnableLiveTvAccess { get; set; }
+
+ public bool EnableMediaPlayback { get; set; }
+ public bool EnableContentDeletion { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether [enable synchronize].
+ /// </summary>
+ /// <value><c>true</c> if [enable synchronize]; otherwise, <c>false</c>.</value>
public bool EnableSync { get; set; }
+
+ public string[] EnabledDevices { get; set; }
+ public bool EnableAllDevices { get; set; }
+
+ public UserPolicy()
+ {
+ EnableLiveTvManagement = true;
+ EnableMediaPlayback = true;
+ EnableLiveTvAccess = true;
+ EnableSharedDeviceControl = true;
+
+ BlockedMediaFolders = new string[] { };
+ BlockedTags = new string[] { };
+ BlockedChannels = new string[] { };
+ BlockUnratedItems = new UnratedItem[] { };
+
+ EnableUserPreferenceAccess = true;
+
+ AccessSchedules = new AccessSchedule[] { };
+
+ EnabledDevices = new string[] { };
+ EnableAllDevices = true;
+ }
}
}