aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2015-02-19 12:50:05 -0500
committerLuke <luke.pulverenti@gmail.com>2015-02-19 12:50:05 -0500
commit8c09665c40776060a09655fb4ea04ec65bdffb73 (patch)
treeb1432a7315a7a7689be21fa2e3cc122350c778b2 /MediaBrowser.Model
parent3cce8731614e6846096bbe54fca8336e7f5d98d9 (diff)
parentf2c3dade77878b48a9a333d745e5d92a0f913233 (diff)
Merge pull request #1016 from MediaBrowser/dev
3.0.5518.5
Diffstat (limited to 'MediaBrowser.Model')
-rw-r--r--MediaBrowser.Model/ApiClient/IConnectionManager.cs7
-rw-r--r--MediaBrowser.Model/ApiClient/NetworkStatus.cs30
-rw-r--r--MediaBrowser.Model/Configuration/ServerConfiguration.cs2
-rw-r--r--MediaBrowser.Model/Dlna/StreamInfo.cs99
-rw-r--r--MediaBrowser.Model/Dto/ImageOptions.cs6
-rw-r--r--MediaBrowser.Model/Dto/UserDto.cs6
-rw-r--r--MediaBrowser.Model/MediaBrowser.Model.csproj1
-rw-r--r--MediaBrowser.Model/Querying/EpisodeQuery.cs51
-rw-r--r--MediaBrowser.Model/Querying/ItemSortBy.cs1
9 files changed, 175 insertions, 28 deletions
diff --git a/MediaBrowser.Model/ApiClient/IConnectionManager.cs b/MediaBrowser.Model/ApiClient/IConnectionManager.cs
index 658c71ac5d..341df27280 100644
--- a/MediaBrowser.Model/ApiClient/IConnectionManager.cs
+++ b/MediaBrowser.Model/ApiClient/IConnectionManager.cs
@@ -55,6 +55,13 @@ namespace MediaBrowser.Model.ApiClient
IApiClient GetApiClient(IHasServerId item);
/// <summary>
+ /// Gets the API client.
+ /// </summary>
+ /// <param name="serverId">The server identifier.</param>
+ /// <returns>IApiClient.</returns>
+ IApiClient GetApiClient(string serverId);
+
+ /// <summary>
/// Connects the specified cancellation token.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
diff --git a/MediaBrowser.Model/ApiClient/NetworkStatus.cs b/MediaBrowser.Model/ApiClient/NetworkStatus.cs
new file mode 100644
index 0000000000..715087607e
--- /dev/null
+++ b/MediaBrowser.Model/ApiClient/NetworkStatus.cs
@@ -0,0 +1,30 @@
+
+namespace MediaBrowser.Model.ApiClient
+{
+ public class NetworkStatus
+ {
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is network available.
+ /// </summary>
+ /// <value><c>true</c> if this instance is network available; otherwise, <c>false</c>.</value>
+ public bool IsNetworkAvailable { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is local network available.
+ /// </summary>
+ /// <value><c>null</c> if [is local network available] contains no value, <c>true</c> if [is local network available]; otherwise, <c>false</c>.</value>
+ public bool? IsLocalNetworkAvailable { get; set; }
+ /// <summary>
+ /// Gets the is any local network available.
+ /// </summary>
+ /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
+ public bool GetIsAnyLocalNetworkAvailable()
+ {
+ if (!IsLocalNetworkAvailable.HasValue)
+ {
+ return IsNetworkAvailable;
+ }
+
+ return IsLocalNetworkAvailable.Value;
+ }
+ }
+}
diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
index c15c76004e..a28d3bd5db 100644
--- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs
+++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
@@ -203,7 +203,7 @@ namespace MediaBrowser.Model.Configuration
public bool EnableAudioArchiveFiles { get; set; }
public bool EnableVideoArchiveFiles { get; set; }
- public bool EnableLegacyCollections { get; set; }
+ public bool EnableLegacyCollectionInView { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="ServerConfiguration" /> class.
diff --git a/MediaBrowser.Model/Dlna/StreamInfo.cs b/MediaBrowser.Model/Dlna/StreamInfo.cs
index 3c2f39b745..57a3899d4d 100644
--- a/MediaBrowser.Model/Dlna/StreamInfo.cs
+++ b/MediaBrowser.Model/Dlna/StreamInfo.cs
@@ -85,12 +85,12 @@ namespace MediaBrowser.Model.Dlna
}
}
- public string ToUrl(string baseUrl)
+ public string ToUrl(string baseUrl, string accessToken)
{
- return ToDlnaUrl(baseUrl);
+ return ToDlnaUrl(baseUrl, accessToken);
}
- public string ToDlnaUrl(string baseUrl)
+ public string ToDlnaUrl(string baseUrl, string accessToken)
{
if (PlayMethod == PlayMethod.DirectPlay)
{
@@ -152,7 +152,47 @@ namespace MediaBrowser.Model.Dlna
return string.Format("Params={0}", string.Join(";", list.ToArray()));
}
- public List<SubtitleStreamInfo> GetExternalSubtitles(string baseUrl, bool includeSelectedTrackOnly)
+ public List<SubtitleStreamInfo> GetExternalSubtitles(bool includeSelectedTrackOnly)
+ {
+ List<SubtitleStreamInfo> list = new List<SubtitleStreamInfo>();
+
+ // First add the selected track
+ if (SubtitleStreamIndex.HasValue)
+ {
+ foreach (MediaStream stream in MediaSource.MediaStreams)
+ {
+ if (stream.Type == MediaStreamType.Subtitle && stream.Index == SubtitleStreamIndex.Value)
+ {
+ SubtitleStreamInfo info = GetSubtitleStreamInfo(stream);
+
+ if (info != null)
+ {
+ list.Add(info);
+ }
+ }
+ }
+ }
+
+ if (!includeSelectedTrackOnly)
+ {
+ foreach (MediaStream stream in MediaSource.MediaStreams)
+ {
+ if (stream.Type == MediaStreamType.Subtitle && (!SubtitleStreamIndex.HasValue || stream.Index != SubtitleStreamIndex.Value))
+ {
+ SubtitleStreamInfo info = GetSubtitleStreamInfo(stream);
+
+ if (info != null)
+ {
+ list.Add(info);
+ }
+ }
+ }
+ }
+
+ return list;
+ }
+
+ public List<SubtitleStreamInfo> GetExternalSubtitles(string baseUrl, string accessToken, bool includeSelectedTrackOnly)
{
if (string.IsNullOrEmpty(baseUrl))
{
@@ -173,7 +213,12 @@ namespace MediaBrowser.Model.Dlna
{
if (stream.Type == MediaStreamType.Subtitle && stream.Index == SubtitleStreamIndex.Value)
{
- AddSubtitle(list, stream, baseUrl, startPositionTicks);
+ SubtitleStreamInfo info = GetSubtitleStreamInfo(stream, baseUrl, accessToken, startPositionTicks);
+
+ if (info != null)
+ {
+ list.Add(info);
+ }
}
}
}
@@ -184,7 +229,12 @@ namespace MediaBrowser.Model.Dlna
{
if (stream.Type == MediaStreamType.Subtitle && (!SubtitleStreamIndex.HasValue || stream.Index != SubtitleStreamIndex.Value))
{
- AddSubtitle(list, stream, baseUrl, startPositionTicks);
+ SubtitleStreamInfo info = GetSubtitleStreamInfo(stream, baseUrl, accessToken, startPositionTicks);
+
+ if (info != null)
+ {
+ list.Add(info);
+ }
}
}
}
@@ -192,32 +242,41 @@ namespace MediaBrowser.Model.Dlna
return list;
}
- private void AddSubtitle(List<SubtitleStreamInfo> list, MediaStream stream, string baseUrl, long startPositionTicks)
+ private SubtitleStreamInfo GetSubtitleStreamInfo(MediaStream stream, string baseUrl, string accessToken, long startPositionTicks)
{
- var subtitleProfile = StreamBuilder.GetSubtitleProfile(stream, DeviceProfile);
+ SubtitleStreamInfo info = GetSubtitleStreamInfo(stream);
- if (subtitleProfile.Method != SubtitleDeliveryMethod.External)
+ if (info != null)
{
- return;
+ info.Url = string.Format("{0}/Videos/{1}/{2}/Subtitles/{3}/{4}/Stream.{5}",
+ baseUrl,
+ ItemId,
+ MediaSourceId,
+ StringHelper.ToStringCultureInvariant(stream.Index),
+ StringHelper.ToStringCultureInvariant(startPositionTicks),
+ SubtitleFormat);
}
- string url = string.Format("{0}/Videos/{1}/{2}/Subtitles/{3}/{4}/Stream.{5}",
- baseUrl,
- ItemId,
- MediaSourceId,
- StringHelper.ToStringCultureInvariant(stream.Index),
- StringHelper.ToStringCultureInvariant(startPositionTicks),
- SubtitleFormat);
+ return info;
+ }
+
+ private SubtitleStreamInfo GetSubtitleStreamInfo(MediaStream stream)
+ {
+ SubtitleProfile subtitleProfile = StreamBuilder.GetSubtitleProfile(stream, DeviceProfile);
+
+ if (subtitleProfile.Method != SubtitleDeliveryMethod.External)
+ {
+ return null;
+ }
- list.Add(new SubtitleStreamInfo
+ return new SubtitleStreamInfo
{
- Url = url,
IsForced = stream.IsForced,
Language = stream.Language,
Name = stream.Language ?? "Unknown",
Format = SubtitleFormat,
Index = stream.Index
- });
+ };
}
/// <summary>
diff --git a/MediaBrowser.Model/Dto/ImageOptions.cs b/MediaBrowser.Model/Dto/ImageOptions.cs
index 8e35c1323f..98bd0279a7 100644
--- a/MediaBrowser.Model/Dto/ImageOptions.cs
+++ b/MediaBrowser.Model/Dto/ImageOptions.cs
@@ -88,6 +88,12 @@ namespace MediaBrowser.Model.Dto
public int? PercentPlayed { get; set; }
/// <summary>
+ /// Gets or sets the un played count.
+ /// </summary>
+ /// <value>The un played count.</value>
+ public int? UnPlayedCount { get; set; }
+
+ /// <summary>
/// Gets or sets the color of the background.
/// </summary>
/// <value>The color of the background.</value>
diff --git a/MediaBrowser.Model/Dto/UserDto.cs b/MediaBrowser.Model/Dto/UserDto.cs
index c66b34150d..fc5d2f134a 100644
--- a/MediaBrowser.Model/Dto/UserDto.cs
+++ b/MediaBrowser.Model/Dto/UserDto.cs
@@ -61,6 +61,12 @@ namespace MediaBrowser.Model.Dto
/// </summary>
/// <value>The offline password.</value>
public string OfflinePassword { get; set; }
+
+ /// <summary>
+ /// Gets or sets the offline password salt.
+ /// </summary>
+ /// <value>The offline password salt.</value>
+ public string OfflinePasswordSalt { get; set; }
/// <summary>
/// Gets or sets the primary image tag.
diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj
index c8e09dd826..9fd632cbd0 100644
--- a/MediaBrowser.Model/MediaBrowser.Model.csproj
+++ b/MediaBrowser.Model/MediaBrowser.Model.csproj
@@ -72,6 +72,7 @@
<Compile Include="ApiClient\IDevice.cs" />
<Compile Include="ApiClient\IServerEvents.cs" />
<Compile Include="ApiClient\GeneralCommandEventArgs.cs" />
+ <Compile Include="ApiClient\NetworkStatus.cs" />
<Compile Include="ApiClient\RemoteLogoutReason.cs" />
<Compile Include="ApiClient\ServerCredentials.cs" />
<Compile Include="ApiClient\ServerDiscoveryInfo.cs" />
diff --git a/MediaBrowser.Model/Querying/EpisodeQuery.cs b/MediaBrowser.Model/Querying/EpisodeQuery.cs
index e2fc3220a1..78fe943e33 100644
--- a/MediaBrowser.Model/Querying/EpisodeQuery.cs
+++ b/MediaBrowser.Model/Querying/EpisodeQuery.cs
@@ -3,20 +3,57 @@ namespace MediaBrowser.Model.Querying
{
public class EpisodeQuery
{
+ /// <summary>
+ /// Gets or sets the user identifier.
+ /// </summary>
+ /// <value>The user identifier.</value>
public string UserId { get; set; }
-
+ /// <summary>
+ /// Gets or sets the season identifier.
+ /// </summary>
+ /// <value>The season identifier.</value>
public string SeasonId { get; set; }
-
+ /// <summary>
+ /// Gets or sets the series identifier.
+ /// </summary>
+ /// <value>The series identifier.</value>
public string SeriesId { get; set; }
-
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is missing.
+ /// </summary>
+ /// <value><c>null</c> if [is missing] contains no value, <c>true</c> if [is missing]; otherwise, <c>false</c>.</value>
public bool? IsMissing { get; set; }
-
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is virtual unaired.
+ /// </summary>
+ /// <value><c>null</c> if [is virtual unaired] contains no value, <c>true</c> if [is virtual unaired]; otherwise, <c>false</c>.</value>
public bool? IsVirtualUnaired { get; set; }
-
+ /// <summary>
+ /// Gets or sets the season number.
+ /// </summary>
+ /// <value>The season number.</value>
public int? SeasonNumber { get; set; }
-
+ /// <summary>
+ /// Gets or sets the fields.
+ /// </summary>
+ /// <value>The fields.</value>
public ItemFields[] Fields { get; set; }
-
+ /// <summary>
+ /// Gets or sets the start index.
+ /// </summary>
+ /// <value>The start index.</value>
+ public int? StartIndex { get; set; }
+ /// <summary>
+ /// Gets or sets the limit.
+ /// </summary>
+ /// <value>The limit.</value>
+ public int? Limit { get; set; }
+ /// <summary>
+ /// Gets or sets the start item identifier.
+ /// </summary>
+ /// <value>The start item identifier.</value>
+ public string StartItemId { get; set; }
+
public EpisodeQuery()
{
Fields = new ItemFields[] { };
diff --git a/MediaBrowser.Model/Querying/ItemSortBy.cs b/MediaBrowser.Model/Querying/ItemSortBy.cs
index 14b80853ac..fcc7e39a19 100644
--- a/MediaBrowser.Model/Querying/ItemSortBy.cs
+++ b/MediaBrowser.Model/Querying/ItemSortBy.cs
@@ -83,5 +83,6 @@ namespace MediaBrowser.Model.Querying
public const string Players = "Players";
public const string GameSystem = "GameSystem";
public const string IsFavoriteOrLiked = "IsFavoriteOrLiked";
+ public const string DateLastContentAdded = "DateLastContentAdded";
}
}