Removed guids from the model project

This commit is contained in:
Luke Pulverenti
2014-05-08 16:09:53 -04:00
parent 374dd8d441
commit f02c326027
72 changed files with 380 additions and 503 deletions

View File

@@ -138,7 +138,7 @@ namespace MediaBrowser.Model.ApiClient
/// <param name="notificationIdList">The notification id list.</param>
/// <param name="isRead">if set to <c>true</c> [is read].</param>
/// <returns>Task.</returns>
Task MarkNotificationsRead(string userId, IEnumerable<Guid> notificationIdList, bool isRead);
Task MarkNotificationsRead(string userId, IEnumerable<string> notificationIdList, bool isRead);
/// <summary>
/// Gets the notifications summary.
@@ -447,7 +447,7 @@ namespace MediaBrowser.Model.ApiClient
/// <param name="id">The id.</param>
/// <returns>Task{TaskInfo}.</returns>
/// <exception cref="ArgumentNullException">id</exception>
Task<TaskInfo> GetScheduledTaskAsync(Guid id);
Task<TaskInfo> GetScheduledTaskAsync(string id);
/// <summary>
/// Gets a user by id
@@ -581,6 +581,38 @@ namespace MediaBrowser.Model.ApiClient
/// <returns>Task.</returns>
Task SendCommandAsync(string sessionId, GeneralCommand command);
/// <summary>
/// Sends the string.
/// </summary>
/// <param name="sessionId">The session identifier.</param>
/// <param name="text">The text.</param>
/// <returns>Task.</returns>
Task SendString(string sessionId, string text);
/// <summary>
/// Sets the volume.
/// </summary>
/// <param name="sessionId">The session identifier.</param>
/// <param name="volume">The volume.</param>
/// <returns>Task.</returns>
Task SetVolume(string sessionId, int volume);
/// <summary>
/// Sets the index of the audio stream.
/// </summary>
/// <param name="sessionId">The session identifier.</param>
/// <param name="volume">The volume.</param>
/// <returns>Task.</returns>
Task SetAudioStreamIndex(string sessionId, int? volume);
/// <summary>
/// Sets the index of the subtitle stream.
/// </summary>
/// <param name="sessionId">The session identifier.</param>
/// <param name="volume">The volume.</param>
/// <returns>Task.</returns>
Task SetSubtitleStreamIndex(string sessionId, int? volume);
/// <summary>
/// Instructs the client to display a message to the user
/// </summary>
@@ -632,7 +664,7 @@ namespace MediaBrowser.Model.ApiClient
/// <param name="triggers">The triggers.</param>
/// <returns>Task{RequestResult}.</returns>
/// <exception cref="ArgumentNullException">id</exception>
Task UpdateScheduledTaskTriggersAsync(Guid id, TaskTriggerInfo[] triggers);
Task UpdateScheduledTaskTriggersAsync(string id, TaskTriggerInfo[] triggers);
/// <summary>
/// Gets the display preferences.

View File

@@ -1,4 +1,11 @@
using System;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Events;
using MediaBrowser.Model.Plugins;
using MediaBrowser.Model.Session;
using MediaBrowser.Model.Tasks;
using MediaBrowser.Model.Updates;
using System;
namespace MediaBrowser.Model.ApiClient
{
@@ -10,59 +17,59 @@ namespace MediaBrowser.Model.ApiClient
/// <summary>
/// Occurs when [user deleted].
/// </summary>
event EventHandler<UserDeletedEventArgs> UserDeleted;
event EventHandler<GenericEventArgs<string>> UserDeleted;
/// <summary>
/// Occurs when [scheduled task started].
/// </summary>
event EventHandler<ScheduledTaskStartedEventArgs> ScheduledTaskStarted;
event EventHandler<GenericEventArgs<string>> ScheduledTaskStarted;
/// <summary>
/// Occurs when [scheduled task ended].
/// </summary>
event EventHandler<ScheduledTaskEndedEventArgs> ScheduledTaskEnded;
event EventHandler<GenericEventArgs<TaskResult>> ScheduledTaskEnded;
/// <summary>
/// Occurs when [package installing].
/// </summary>
event EventHandler<PackageInstallationEventArgs> PackageInstalling;
event EventHandler<GenericEventArgs<InstallationInfo>> PackageInstalling;
/// <summary>
/// Occurs when [package installation failed].
/// </summary>
event EventHandler<PackageInstallationEventArgs> PackageInstallationFailed;
event EventHandler<GenericEventArgs<InstallationInfo>> PackageInstallationFailed;
/// <summary>
/// Occurs when [package installation completed].
/// </summary>
event EventHandler<PackageInstallationEventArgs> PackageInstallationCompleted;
event EventHandler<GenericEventArgs<InstallationInfo>> PackageInstallationCompleted;
/// <summary>
/// Occurs when [package installation cancelled].
/// </summary>
event EventHandler<PackageInstallationEventArgs> PackageInstallationCancelled;
event EventHandler<GenericEventArgs<InstallationInfo>> PackageInstallationCancelled;
/// <summary>
/// Occurs when [user updated].
/// </summary>
event EventHandler<UserUpdatedEventArgs> UserUpdated;
event EventHandler<GenericEventArgs<UserDto>> UserUpdated;
/// <summary>
/// Occurs when [plugin uninstalled].
/// </summary>
event EventHandler<PluginUninstallEventArgs> PluginUninstalled;
event EventHandler<GenericEventArgs<PluginInfo>> PluginUninstalled;
/// <summary>
/// Occurs when [library changed].
/// </summary>
event EventHandler<LibraryChangedEventArgs> LibraryChanged;
event EventHandler<GenericEventArgs<LibraryUpdateInfo>> LibraryChanged;
/// <summary>
/// Occurs when [browse command].
/// </summary>
event EventHandler<BrowseRequestEventArgs> BrowseCommand;
event EventHandler<GenericEventArgs<BrowseRequest>> BrowseCommand;
/// <summary>
/// Occurs when [play command].
/// </summary>
event EventHandler<PlayRequestEventArgs> PlayCommand;
event EventHandler<GenericEventArgs<PlayRequest>> PlayCommand;
/// <summary>
/// Occurs when [playstate command].
/// </summary>
event EventHandler<PlaystateRequestEventArgs> PlaystateCommand;
event EventHandler<GenericEventArgs<PlaystateRequest>> PlaystateCommand;
/// <summary>
/// Occurs when [message command].
/// </summary>
event EventHandler<MessageCommandEventArgs> MessageCommand;
event EventHandler<GenericEventArgs<MessageCommand>> MessageCommand;
/// <summary>
/// Occurs when [system command].
/// </summary>
@@ -88,6 +95,22 @@ namespace MediaBrowser.Model.ApiClient
/// </summary>
event EventHandler<EventArgs> ServerShuttingDown;
/// <summary>
/// Occurs when [send text command].
/// </summary>
event EventHandler<GenericEventArgs<string>> SendTextCommand;
/// <summary>
/// Occurs when [set volume command].
/// </summary>
event EventHandler<GenericEventArgs<int>> SetVolumeCommand;
/// <summary>
/// Occurs when [set audio stream index command].
/// </summary>
event EventHandler<GenericEventArgs<int>> SetAudioStreamIndexCommand;
/// <summary>
/// Occurs when [set video stream index command].
/// </summary>
event EventHandler<GenericEventArgs<int>> SetVideoStreamIndexCommand;
/// <summary>
/// Occurs when [sessions updated].
/// </summary>
event EventHandler<SessionUpdatesEventArgs> SessionsUpdated;
@@ -98,7 +121,7 @@ namespace MediaBrowser.Model.ApiClient
/// <summary>
/// Occurs when [user data changed].
/// </summary>
event EventHandler<UserDataChangedEventArgs> UserDataChanged;
event EventHandler<GenericEventArgs<UserDataChangeInfo>> UserDataChanged;
/// <summary>
/// Occurs when [connected].
/// </summary>

View File

@@ -1,154 +1,8 @@
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Plugins;
using MediaBrowser.Model.Session;
using MediaBrowser.Model.Tasks;
using MediaBrowser.Model.Updates;
using MediaBrowser.Model.Session;
using System;
namespace MediaBrowser.Model.ApiClient
{
/// <summary>
/// Class UserDeletedEventArgs
/// </summary>
public class UserDeletedEventArgs : EventArgs
{
/// <summary>
/// Gets or sets the id.
/// </summary>
/// <value>The id.</value>
public string Id { get; set; }
}
public class UserDataChangedEventArgs : EventArgs
{
/// <summary>
/// Gets or sets the user.
/// </summary>
/// <value>The user.</value>
public UserDataChangeInfo ChangeInfo { get; set; }
}
/// <summary>
/// Class UserUpdatedEventArgs
/// </summary>
public class UserUpdatedEventArgs : EventArgs
{
/// <summary>
/// Gets or sets the user.
/// </summary>
/// <value>The user.</value>
public UserDto User { get; set; }
}
/// <summary>
/// Class ScheduledTaskStartedEventArgs
/// </summary>
public class ScheduledTaskStartedEventArgs : EventArgs
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
public string Name { get; set; }
}
/// <summary>
/// Class ScheduledTaskEndedEventArgs
/// </summary>
public class ScheduledTaskEndedEventArgs : EventArgs
{
/// <summary>
/// Gets or sets the result.
/// </summary>
/// <value>The result.</value>
public TaskResult Result { get; set; }
}
/// <summary>
/// Class PackageInstallationEventArgs
/// </summary>
public class PackageInstallationEventArgs : EventArgs
{
/// <summary>
/// Gets or sets the installation info.
/// </summary>
/// <value>The installation info.</value>
public InstallationInfo InstallationInfo { get; set; }
}
/// <summary>
/// Class PluginUninstallEventArgs
/// </summary>
public class PluginUninstallEventArgs : EventArgs
{
/// <summary>
/// Gets or sets the plugin info.
/// </summary>
/// <value>The plugin info.</value>
public PluginInfo PluginInfo { get; set; }
}
/// <summary>
/// Class LibraryChangedEventArgs
/// </summary>
public class LibraryChangedEventArgs : EventArgs
{
/// <summary>
/// Gets or sets the update info.
/// </summary>
/// <value>The update info.</value>
public LibraryUpdateInfo UpdateInfo { get; set; }
}
/// <summary>
/// Class BrowseRequestEventArgs
/// </summary>
public class BrowseRequestEventArgs : EventArgs
{
/// <summary>
/// Gets or sets the request.
/// </summary>
/// <value>The request.</value>
public BrowseRequest Request { get; set; }
}
/// <summary>
/// Class PlayRequestEventArgs
/// </summary>
public class PlayRequestEventArgs : EventArgs
{
/// <summary>
/// Gets or sets the request.
/// </summary>
/// <value>The request.</value>
public PlayRequest Request { get; set; }
}
/// <summary>
/// Class PlaystateRequestEventArgs
/// </summary>
public class PlaystateRequestEventArgs : EventArgs
{
/// <summary>
/// Gets or sets the request.
/// </summary>
/// <value>The request.</value>
public PlaystateRequest Request { get; set; }
}
/// <summary>
/// Class MessageCommandEventArgs
/// </summary>
public class MessageCommandEventArgs : EventArgs
{
/// <summary>
/// Gets or sets the request.
/// </summary>
/// <value>The request.</value>
public MessageCommand Request { get; set; }
}
/// <summary>
/// Class SystemCommandEventArgs
/// </summary>

View File

@@ -30,7 +30,7 @@ namespace MediaBrowser.Model.Configuration
public MetadataOptions(int backdropLimit, int minBackdropWidth)
{
var imageOptions = new List<ImageOption>
List<ImageOption> imageOptions = new List<ImageOption>
{
new ImageOption
{
@@ -52,14 +52,14 @@ namespace MediaBrowser.Model.Configuration
public int GetLimit(ImageType type)
{
var option = ImageOptions.FirstOrDefault(i => i.Type == type);
ImageOption option = ImageOptions.FirstOrDefault(i => i.Type == type);
return option == null ? 1 : option.Limit;
}
public int GetMinWidth(ImageType type)
{
var option = ImageOptions.FirstOrDefault(i => i.Type == type);
ImageOption option = ImageOptions.FirstOrDefault(i => i.Type == type);
return option == null ? 0 : option.MinWidth;
}

View File

@@ -1,7 +1,6 @@
using System;
using MediaBrowser.Model.MediaInfo;
using System;
using System.Collections.Generic;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.MediaInfo;
namespace MediaBrowser.Model.Dlna
{

View File

@@ -16,22 +16,22 @@ namespace MediaBrowser.Model.Dlna
{
ValidateAudioInput(options);
var mediaSources = options.MediaSources;
List<MediaSourceInfo> mediaSources = options.MediaSources;
// If the client wants a specific media soure, filter now
if (!string.IsNullOrEmpty(options.MediaSourceId))
{
// Avoid implicitly captured closure
var mediaSourceId = options.MediaSourceId;
string mediaSourceId = options.MediaSourceId;
mediaSources = mediaSources
.Where(i => string.Equals(i.Id, mediaSourceId, StringComparison.OrdinalIgnoreCase))
.ToList();
}
var streams = mediaSources.Select(i => BuildAudioItem(i, options)).ToList();
List<StreamInfo> streams = mediaSources.Select(i => BuildAudioItem(i, options)).ToList();
foreach (var stream in streams)
foreach (StreamInfo stream in streams)
{
stream.DeviceId = options.DeviceId;
stream.DeviceProfileId = options.Profile.Id;
@@ -44,22 +44,22 @@ namespace MediaBrowser.Model.Dlna
{
ValidateInput(options);
var mediaSources = options.MediaSources;
List<MediaSourceInfo> mediaSources = options.MediaSources;
// If the client wants a specific media soure, filter now
if (!string.IsNullOrEmpty(options.MediaSourceId))
{
// Avoid implicitly captured closure
var mediaSourceId = options.MediaSourceId;
string mediaSourceId = options.MediaSourceId;
mediaSources = mediaSources
.Where(i => string.Equals(i.Id, mediaSourceId, StringComparison.OrdinalIgnoreCase))
.ToList();
}
var streams = mediaSources.Select(i => BuildVideoItem(i, options)).ToList();
List<StreamInfo> streams = mediaSources.Select(i => BuildVideoItem(i, options)).ToList();
foreach (var stream in streams)
foreach (StreamInfo stream in streams)
{
stream.DeviceId = options.DeviceId;
stream.DeviceProfileId = options.Profile.Id;
@@ -78,7 +78,7 @@ namespace MediaBrowser.Model.Dlna
private StreamInfo BuildAudioItem(MediaSourceInfo item, AudioOptions options)
{
var playlistItem = new StreamInfo
StreamInfo playlistItem = new StreamInfo
{
ItemId = options.ItemId,
MediaType = DlnaProfileType.Audio,
@@ -86,30 +86,30 @@ namespace MediaBrowser.Model.Dlna
RunTimeTicks = item.RunTimeTicks
};
var maxBitrateSetting = options.MaxBitrate ?? options.Profile.MaxBitrate;
int? maxBitrateSetting = options.MaxBitrate ?? options.Profile.MaxBitrate;
var audioStream = item.MediaStreams.FirstOrDefault(i => i.Type == MediaStreamType.Audio);
MediaStream audioStream = item.MediaStreams.FirstOrDefault(i => i.Type == MediaStreamType.Audio);
// Honor the max bitrate setting
if (IsAudioEligibleForDirectPlay(item, maxBitrateSetting))
{
var directPlay = options.Profile.DirectPlayProfiles
DirectPlayProfile directPlay = options.Profile.DirectPlayProfiles
.FirstOrDefault(i => i.Type == playlistItem.MediaType && IsAudioDirectPlaySupported(i, item, audioStream));
if (directPlay != null)
{
var audioCodec = audioStream == null ? null : audioStream.Codec;
string audioCodec = audioStream == null ? null : audioStream.Codec;
// Make sure audio codec profiles are satisfied
if (!string.IsNullOrEmpty(audioCodec))
{
var conditionProcessor = new ConditionProcessor();
ConditionProcessor conditionProcessor = new ConditionProcessor();
var conditions = options.Profile.CodecProfiles.Where(i => i.Type == CodecType.Audio && i.ContainsCodec(audioCodec))
IEnumerable<ProfileCondition> conditions = options.Profile.CodecProfiles.Where(i => i.Type == CodecType.Audio && i.ContainsCodec(audioCodec))
.SelectMany(i => i.Conditions);
var audioChannels = audioStream == null ? null : audioStream.Channels;
var audioBitrate = audioStream == null ? null : audioStream.BitRate;
int? audioChannels = audioStream.Channels;
int? audioBitrate = audioStream.BitRate;
if (conditions.All(c => conditionProcessor.IsAudioConditionSatisfied(c, audioChannels, audioBitrate)))
{
@@ -122,7 +122,7 @@ namespace MediaBrowser.Model.Dlna
}
}
var transcodingProfile = options.Profile.TranscodingProfiles
TranscodingProfile transcodingProfile = options.Profile.TranscodingProfiles
.FirstOrDefault(i => i.Type == playlistItem.MediaType);
if (transcodingProfile != null)
@@ -134,7 +134,7 @@ namespace MediaBrowser.Model.Dlna
playlistItem.AudioCodec = transcodingProfile.AudioCodec;
playlistItem.Protocol = transcodingProfile.Protocol;
var audioTranscodingConditions = options.Profile.CodecProfiles
IEnumerable<ProfileCondition> audioTranscodingConditions = options.Profile.CodecProfiles
.Where(i => i.Type == CodecType.Audio && i.ContainsCodec(transcodingProfile.AudioCodec))
.Take(1)
.SelectMany(i => i.Conditions);
@@ -144,7 +144,7 @@ namespace MediaBrowser.Model.Dlna
// Honor requested max channels
if (options.MaxAudioChannels.HasValue)
{
var currentValue = playlistItem.MaxAudioChannels ?? options.MaxAudioChannels.Value;
int currentValue = playlistItem.MaxAudioChannels ?? options.MaxAudioChannels.Value;
playlistItem.MaxAudioChannels = Math.Min(options.MaxAudioChannels.Value, currentValue);
}
@@ -152,7 +152,7 @@ namespace MediaBrowser.Model.Dlna
// Honor requested max bitrate
if (maxBitrateSetting.HasValue)
{
var currentValue = playlistItem.AudioBitrate ?? maxBitrateSetting.Value;
int currentValue = playlistItem.AudioBitrate ?? maxBitrateSetting.Value;
playlistItem.AudioBitrate = Math.Min(maxBitrateSetting.Value, currentValue);
}
@@ -163,7 +163,7 @@ namespace MediaBrowser.Model.Dlna
private StreamInfo BuildVideoItem(MediaSourceInfo item, VideoOptions options)
{
var playlistItem = new StreamInfo
StreamInfo playlistItem = new StreamInfo
{
ItemId = options.ItemId,
MediaType = DlnaProfileType.Video,
@@ -171,15 +171,15 @@ namespace MediaBrowser.Model.Dlna
RunTimeTicks = item.RunTimeTicks
};
var audioStream = item.MediaStreams.FirstOrDefault(i => i.Type == MediaStreamType.Audio);
var videoStream = item.MediaStreams.FirstOrDefault(i => i.Type == MediaStreamType.Video);
MediaStream audioStream = item.MediaStreams.FirstOrDefault(i => i.Type == MediaStreamType.Audio);
MediaStream videoStream = item.MediaStreams.FirstOrDefault(i => i.Type == MediaStreamType.Video);
var maxBitrateSetting = options.MaxBitrate ?? options.Profile.MaxBitrate;
int? maxBitrateSetting = options.MaxBitrate ?? options.Profile.MaxBitrate;
if (IsEligibleForDirectPlay(item, options, maxBitrateSetting))
{
// See if it can be direct played
var directPlay = GetVideoDirectPlayProfile(options.Profile, item, videoStream, audioStream);
DirectPlayProfile directPlay = GetVideoDirectPlayProfile(options.Profile, item, videoStream, audioStream);
if (directPlay != null)
{
@@ -191,7 +191,7 @@ namespace MediaBrowser.Model.Dlna
}
// Can't direct play, find the transcoding profile
var transcodingProfile = options.Profile.TranscodingProfiles
TranscodingProfile transcodingProfile = options.Profile.TranscodingProfiles
.FirstOrDefault(i => i.Type == playlistItem.MediaType);
if (transcodingProfile != null)
@@ -206,14 +206,14 @@ namespace MediaBrowser.Model.Dlna
playlistItem.AudioStreamIndex = options.AudioStreamIndex;
playlistItem.SubtitleStreamIndex = options.SubtitleStreamIndex;
var videoTranscodingConditions = options.Profile.CodecProfiles
IEnumerable<ProfileCondition> videoTranscodingConditions = options.Profile.CodecProfiles
.Where(i => i.Type == CodecType.Video && i.ContainsCodec(transcodingProfile.VideoCodec))
.Take(1)
.SelectMany(i => i.Conditions);
ApplyTranscodingConditions(playlistItem, videoTranscodingConditions);
var audioTranscodingConditions = options.Profile.CodecProfiles
IEnumerable<ProfileCondition> audioTranscodingConditions = options.Profile.CodecProfiles
.Where(i => i.Type == CodecType.VideoAudio && i.ContainsCodec(transcodingProfile.AudioCodec))
.Take(1)
.SelectMany(i => i.Conditions);
@@ -223,7 +223,7 @@ namespace MediaBrowser.Model.Dlna
// Honor requested max channels
if (options.MaxAudioChannels.HasValue)
{
var currentValue = playlistItem.MaxAudioChannels ?? options.MaxAudioChannels.Value;
int currentValue = playlistItem.MaxAudioChannels ?? options.MaxAudioChannels.Value;
playlistItem.MaxAudioChannels = Math.Min(options.MaxAudioChannels.Value, currentValue);
}
@@ -231,7 +231,7 @@ namespace MediaBrowser.Model.Dlna
// Honor requested max bitrate
if (options.MaxAudioTranscodingBitrate.HasValue)
{
var currentValue = playlistItem.AudioBitrate ?? options.MaxAudioTranscodingBitrate.Value;
int currentValue = playlistItem.AudioBitrate ?? options.MaxAudioTranscodingBitrate.Value;
playlistItem.AudioBitrate = Math.Min(options.MaxAudioTranscodingBitrate.Value, currentValue);
}
@@ -239,14 +239,14 @@ namespace MediaBrowser.Model.Dlna
// Honor max rate
if (maxBitrateSetting.HasValue)
{
var videoBitrate = maxBitrateSetting.Value;
int videoBitrate = maxBitrateSetting.Value;
if (playlistItem.AudioBitrate.HasValue)
{
videoBitrate -= playlistItem.AudioBitrate.Value;
}
var currentValue = playlistItem.VideoBitrate ?? videoBitrate;
int currentValue = playlistItem.VideoBitrate ?? videoBitrate;
playlistItem.VideoBitrate = Math.Min(videoBitrate, currentValue);
}
@@ -261,7 +261,7 @@ namespace MediaBrowser.Model.Dlna
MediaStream audioStream)
{
// See if it can be direct played
var directPlay = profile.DirectPlayProfiles
DirectPlayProfile directPlay = profile.DirectPlayProfiles
.FirstOrDefault(i => i.Type == DlnaProfileType.Video && IsVideoDirectPlaySupported(i, mediaSource, videoStream, audioStream));
if (directPlay == null)
@@ -269,28 +269,28 @@ namespace MediaBrowser.Model.Dlna
return null;
}
var container = mediaSource.Container;
string container = mediaSource.Container;
var conditions = profile.ContainerProfiles
IEnumerable<ProfileCondition> conditions = profile.ContainerProfiles
.Where(i => i.Type == DlnaProfileType.Video && i.GetContainers().Contains(container, StringComparer.OrdinalIgnoreCase))
.SelectMany(i => i.Conditions);
var conditionProcessor = new ConditionProcessor();
ConditionProcessor conditionProcessor = new ConditionProcessor();
var width = videoStream == null ? null : videoStream.Width;
var height = videoStream == null ? null : videoStream.Height;
var bitDepth = videoStream == null ? null : videoStream.BitDepth;
var videoBitrate = videoStream == null ? null : videoStream.BitRate;
var videoLevel = videoStream == null ? null : videoStream.Level;
var videoProfile = videoStream == null ? null : videoStream.Profile;
var videoFramerate = videoStream == null ? null : videoStream.AverageFrameRate ?? videoStream.AverageFrameRate;
int? width = videoStream == null ? null : videoStream.Width;
int? height = videoStream == null ? null : videoStream.Height;
int? bitDepth = videoStream == null ? null : videoStream.BitDepth;
int? videoBitrate = videoStream == null ? null : videoStream.BitRate;
double? videoLevel = videoStream == null ? null : videoStream.Level;
string videoProfile = videoStream == null ? null : videoStream.Profile;
float? videoFramerate = videoStream == null ? null : videoStream.AverageFrameRate ?? videoStream.AverageFrameRate;
var audioBitrate = audioStream == null ? null : audioStream.BitRate;
var audioChannels = audioStream == null ? null : audioStream.Channels;
var audioProfile = audioStream == null ? null : audioStream.Profile;
int? audioBitrate = audioStream == null ? null : audioStream.BitRate;
int? audioChannels = audioStream == null ? null : audioStream.Channels;
string audioProfile = audioStream == null ? null : audioStream.Profile;
var timestamp = videoStream == null ? TransportStreamTimestamp.None : mediaSource.Timestamp;
var packetLength = videoStream == null ? null : videoStream.PacketLength;
TransportStreamTimestamp? timestamp = videoStream == null ? TransportStreamTimestamp.None : mediaSource.Timestamp;
int? packetLength = videoStream == null ? null : videoStream.PacketLength;
// Check container conditions
if (!conditions.All(i => conditionProcessor.IsVideoConditionSatisfied(i,
@@ -309,7 +309,7 @@ namespace MediaBrowser.Model.Dlna
return null;
}
var videoCodec = videoStream == null ? null : videoStream.Codec;
string videoCodec = videoStream == null ? null : videoStream.Codec;
if (string.IsNullOrEmpty(videoCodec))
{
@@ -338,7 +338,7 @@ namespace MediaBrowser.Model.Dlna
if (audioStream != null)
{
var audioCodec = audioStream.Codec;
string audioCodec = audioStream.Codec;
if (string.IsNullOrEmpty(audioCodec))
{
@@ -420,10 +420,10 @@ namespace MediaBrowser.Model.Dlna
private void ApplyTranscodingConditions(StreamInfo item, IEnumerable<ProfileCondition> conditions)
{
foreach (var condition in conditions
foreach (ProfileCondition condition in conditions
.Where(i => !string.IsNullOrEmpty(i.Value)))
{
var value = condition.Value;
string value = condition.Value;
switch (condition.Property)
{
@@ -515,7 +515,7 @@ namespace MediaBrowser.Model.Dlna
if (profile.Container.Length > 0)
{
// Check container type
var mediaContainer = item.Container ?? string.Empty;
string mediaContainer = item.Container ?? string.Empty;
if (!profile.GetContainers().Any(i => string.Equals(i, mediaContainer, StringComparison.OrdinalIgnoreCase)))
{
return false;
@@ -536,7 +536,7 @@ namespace MediaBrowser.Model.Dlna
if (profile.Container.Length > 0)
{
// Check container type
var mediaContainer = item.Container ?? string.Empty;
string mediaContainer = item.Container ?? string.Empty;
if (!profile.GetContainers().Any(i => string.Equals(i, mediaContainer, StringComparison.OrdinalIgnoreCase)))
{
return false;
@@ -544,21 +544,21 @@ namespace MediaBrowser.Model.Dlna
}
// Check video codec
var videoCodecs = profile.GetVideoCodecs();
List<string> videoCodecs = profile.GetVideoCodecs();
if (videoCodecs.Count > 0)
{
var videoCodec = videoStream == null ? null : videoStream.Codec;
string videoCodec = videoStream == null ? null : videoStream.Codec;
if (string.IsNullOrEmpty(videoCodec) || !videoCodecs.Contains(videoCodec, StringComparer.OrdinalIgnoreCase))
{
return false;
}
}
var audioCodecs = profile.GetAudioCodecs();
List<string> audioCodecs = profile.GetAudioCodecs();
if (audioCodecs.Count > 0)
{
// Check audio codecs
var audioCodec = audioStream == null ? null : audioStream.Codec;
string audioCodec = audioStream == null ? null : audioStream.Codec;
if (string.IsNullOrEmpty(audioCodec) || !audioCodecs.Contains(audioCodec, StringComparer.OrdinalIgnoreCase))
{
return false;

View File

@@ -79,9 +79,9 @@ namespace MediaBrowser.Model.Dlna
throw new ArgumentNullException(baseUrl);
}
var dlnaCommand = BuildDlnaParam(this);
string dlnaCommand = BuildDlnaParam(this);
var extension = string.IsNullOrEmpty(Container) ? string.Empty : "." + Container;
string extension = string.IsNullOrEmpty(Container) ? string.Empty : "." + Container;
baseUrl = baseUrl.TrimEnd('/');
@@ -98,11 +98,11 @@ namespace MediaBrowser.Model.Dlna
return string.Format("{0}/videos/{1}/stream{2}?{3}", baseUrl, ItemId, extension, dlnaCommand);
}
private static readonly CultureInfo UsCulture = new CultureInfo("en-US");
private static string BuildDlnaParam(StreamInfo item)
{
var usCulture = new CultureInfo("en-US");
var list = new List<string>
List<string> list = new List<string>
{
item.DeviceProfileId ?? string.Empty,
item.DeviceId ?? string.Empty,
@@ -110,16 +110,16 @@ namespace MediaBrowser.Model.Dlna
(item.IsDirectStream).ToString().ToLower(),
item.VideoCodec ?? string.Empty,
item.AudioCodec ?? string.Empty,
item.AudioStreamIndex.HasValue ? item.AudioStreamIndex.Value.ToString(usCulture) : string.Empty,
item.SubtitleStreamIndex.HasValue ? item.SubtitleStreamIndex.Value.ToString(usCulture) : string.Empty,
item.VideoBitrate.HasValue ? item.VideoBitrate.Value.ToString(usCulture) : string.Empty,
item.AudioBitrate.HasValue ? item.AudioBitrate.Value.ToString(usCulture) : string.Empty,
item.MaxAudioChannels.HasValue ? item.MaxAudioChannels.Value.ToString(usCulture) : string.Empty,
item.MaxFramerate.HasValue ? item.MaxFramerate.Value.ToString(usCulture) : string.Empty,
item.MaxWidth.HasValue ? item.MaxWidth.Value.ToString(usCulture) : string.Empty,
item.MaxHeight.HasValue ? item.MaxHeight.Value.ToString(usCulture) : string.Empty,
item.StartPositionTicks.ToString(usCulture),
item.VideoLevel.HasValue ? item.VideoLevel.Value.ToString(usCulture) : string.Empty
item.AudioStreamIndex.HasValue ? item.AudioStreamIndex.Value.ToString(UsCulture) : string.Empty,
item.SubtitleStreamIndex.HasValue ? item.SubtitleStreamIndex.Value.ToString(UsCulture) : string.Empty,
item.VideoBitrate.HasValue ? item.VideoBitrate.Value.ToString(UsCulture) : string.Empty,
item.AudioBitrate.HasValue ? item.AudioBitrate.Value.ToString(UsCulture) : string.Empty,
item.MaxAudioChannels.HasValue ? item.MaxAudioChannels.Value.ToString(UsCulture) : string.Empty,
item.MaxFramerate.HasValue ? item.MaxFramerate.Value.ToString(UsCulture) : string.Empty,
item.MaxWidth.HasValue ? item.MaxWidth.Value.ToString(UsCulture) : string.Empty,
item.MaxHeight.HasValue ? item.MaxHeight.Value.ToString(UsCulture) : string.Empty,
item.StartPositionTicks.ToString(UsCulture),
item.VideoLevel.HasValue ? item.VideoLevel.Value.ToString(UsCulture) : string.Empty
};
return string.Format("Params={0}", string.Join(";", list.ToArray()));
@@ -134,7 +134,7 @@ namespace MediaBrowser.Model.Dlna
{
if (MediaSource != null)
{
var audioStreams = MediaSource.MediaStreams.Where(i => i.Type == MediaStreamType.Audio);
IEnumerable<MediaStream> audioStreams = MediaSource.MediaStreams.Where(i => i.Type == MediaStreamType.Audio);
if (AudioStreamIndex.HasValue)
{
@@ -172,7 +172,7 @@ namespace MediaBrowser.Model.Dlna
{
get
{
var stream = TargetAudioStream;
MediaStream stream = TargetAudioStream;
return stream == null ? null : stream.SampleRate;
}
}
@@ -184,7 +184,7 @@ namespace MediaBrowser.Model.Dlna
{
get
{
var stream = TargetVideoStream;
MediaStream stream = TargetVideoStream;
return stream == null || !IsDirectStream ? null : stream.BitDepth;
}
}
@@ -196,7 +196,7 @@ namespace MediaBrowser.Model.Dlna
{
get
{
var stream = TargetVideoStream;
MediaStream stream = TargetVideoStream;
return MaxFramerate.HasValue && !IsDirectStream
? MaxFramerate
: stream == null ? null : stream.AverageFrameRate ?? stream.RealFrameRate;
@@ -210,7 +210,7 @@ namespace MediaBrowser.Model.Dlna
{
get
{
var stream = TargetVideoStream;
MediaStream stream = TargetVideoStream;
return VideoLevel.HasValue && !IsDirectStream
? VideoLevel
: stream == null ? null : stream.Level;
@@ -224,7 +224,7 @@ namespace MediaBrowser.Model.Dlna
{
get
{
var stream = TargetVideoStream;
MediaStream stream = TargetVideoStream;
return !IsDirectStream
? null
: stream == null ? null : stream.PacketLength;
@@ -238,7 +238,7 @@ namespace MediaBrowser.Model.Dlna
{
get
{
var stream = TargetVideoStream;
MediaStream stream = TargetVideoStream;
return !string.IsNullOrEmpty(VideoProfile) && !IsDirectStream
? VideoProfile
: stream == null ? null : stream.Profile;
@@ -252,7 +252,7 @@ namespace MediaBrowser.Model.Dlna
{
get
{
var stream = TargetAudioStream;
MediaStream stream = TargetAudioStream;
return AudioBitrate.HasValue && !IsDirectStream
? AudioBitrate
: stream == null ? null : stream.BitRate;
@@ -266,8 +266,8 @@ namespace MediaBrowser.Model.Dlna
{
get
{
var stream = TargetAudioStream;
var streamChannels = stream == null ? null : stream.Channels;
MediaStream stream = TargetAudioStream;
int? streamChannels = stream == null ? null : stream.Channels;
return MaxAudioChannels.HasValue && !IsDirectStream
? (streamChannels.HasValue ? Math.Min(MaxAudioChannels.Value, streamChannels.Value) : MaxAudioChannels.Value)
@@ -282,7 +282,7 @@ namespace MediaBrowser.Model.Dlna
{
get
{
var stream = TargetAudioStream;
MediaStream stream = TargetAudioStream;
return IsDirectStream
? (stream == null ? null : stream.Codec)
@@ -304,10 +304,10 @@ namespace MediaBrowser.Model.Dlna
if (RunTimeTicks.HasValue)
{
var totalBitrate = TargetTotalBitrate;
int? totalBitrate = TargetTotalBitrate;
return totalBitrate.HasValue ?
Convert.ToInt64(totalBitrate * TimeSpan.FromTicks(RunTimeTicks.Value).TotalSeconds) :
Convert.ToInt64(totalBitrate.Value * TimeSpan.FromTicks(RunTimeTicks.Value).TotalSeconds) :
(long?)null;
}
@@ -319,7 +319,7 @@ namespace MediaBrowser.Model.Dlna
{
get
{
var stream = TargetVideoStream;
MediaStream stream = TargetVideoStream;
return VideoBitrate.HasValue && !IsDirectStream
? VideoBitrate
@@ -331,7 +331,7 @@ namespace MediaBrowser.Model.Dlna
{
get
{
var defaultValue = string.Equals(Container, "m2ts", StringComparison.OrdinalIgnoreCase)
TransportStreamTimestamp defaultValue = string.Equals(Container, "m2ts", StringComparison.OrdinalIgnoreCase)
? TransportStreamTimestamp.Valid
: TransportStreamTimestamp.None;
@@ -353,17 +353,17 @@ namespace MediaBrowser.Model.Dlna
{
get
{
var videoStream = TargetVideoStream;
MediaStream videoStream = TargetVideoStream;
if (videoStream != null && videoStream.Width.HasValue && videoStream.Height.HasValue)
{
var size = new ImageSize
ImageSize size = new ImageSize
{
Width = videoStream.Width.Value,
Height = videoStream.Height.Value
};
var newSize = DrawingUtils.Resize(size,
ImageSize newSize = DrawingUtils.Resize(size,
null,
null,
MaxWidth,
@@ -380,17 +380,17 @@ namespace MediaBrowser.Model.Dlna
{
get
{
var videoStream = TargetVideoStream;
MediaStream videoStream = TargetVideoStream;
if (videoStream != null && videoStream.Width.HasValue && videoStream.Height.HasValue)
{
var size = new ImageSize
ImageSize size = new ImageSize
{
Width = videoStream.Width.Value,
Height = videoStream.Height.Value
};
var newSize = DrawingUtils.Resize(size,
ImageSize newSize = DrawingUtils.Resize(size,
null,
null,
MaxWidth,

View File

@@ -16,7 +16,12 @@ namespace MediaBrowser.Model.Drawing
/// <returns>ImageSize.</returns>
public static ImageSize Scale(double currentWidth, double currentHeight, double scaleFactor)
{
return Scale(new ImageSize { Width = currentWidth, Height = currentHeight }, scaleFactor);
return Scale(new ImageSize
{
Width = currentWidth,
Height = currentHeight
}, scaleFactor);
}
/// <summary>
@@ -29,7 +34,7 @@ namespace MediaBrowser.Model.Drawing
{
var newWidth = size.Width * scaleFactor;
return Resize(size.Width, size.Height, newWidth);
return Resize(size.Width, size.Height, newWidth, null, null, null);
}
/// <summary>
@@ -42,9 +47,19 @@ namespace MediaBrowser.Model.Drawing
/// <param name="maxWidth">A max fixed width, if desired</param>
/// <param name="maxHeight">A max fixed height, if desired</param>
/// <returns>ImageSize.</returns>
public static ImageSize Resize(double currentWidth, double currentHeight, double? width = null, double? height = null, double? maxWidth = null, double? maxHeight = null)
public static ImageSize Resize(double currentWidth,
double currentHeight,
double? width,
double? height,
double? maxWidth,
double? maxHeight)
{
return Resize(new ImageSize { Width = currentWidth, Height = currentHeight }, width, height, maxWidth, maxHeight);
return Resize(new ImageSize
{
Width = currentWidth,
Height = currentHeight
}, width, height, maxWidth, maxHeight);
}
/// <summary>
@@ -56,7 +71,11 @@ namespace MediaBrowser.Model.Drawing
/// <param name="maxWidth">A max fixed width, if desired</param>
/// <param name="maxHeight">A max fixed height, if desired</param>
/// <returns>A new size object</returns>
public static ImageSize Resize(ImageSize size, double? width = null, double? height = null, double? maxWidth = null, double? maxHeight = null)
public static ImageSize Resize(ImageSize size,
double? width,
double? height,
double? maxWidth,
double? maxHeight)
{
double newWidth = size.Width;
double newHeight = size.Height;
@@ -79,13 +98,13 @@ namespace MediaBrowser.Model.Drawing
newWidth = width.Value;
}
if (maxHeight.HasValue && maxHeight < newHeight)
if (maxHeight.HasValue && maxHeight.Value < newHeight)
{
newWidth = GetNewWidth(newHeight, newWidth, maxHeight.Value);
newHeight = maxHeight.Value;
}
if (maxWidth.HasValue && maxWidth < newWidth)
if (maxWidth.HasValue && maxWidth.Value < newWidth)
{
newHeight = GetNewHeight(newHeight, newWidth, maxWidth.Value);
newWidth = maxWidth.Value;
@@ -186,7 +205,7 @@ namespace MediaBrowser.Model.Drawing
{
if (!string.IsNullOrEmpty(value))
{
var parts = value.Split('-');
string[] parts = value.Split('-');
if (parts.Length == 2)
{

View File

@@ -311,7 +311,7 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the parent backdrop image tags.
/// </summary>
/// <value>The parent backdrop image tags.</value>
public List<Guid> ParentBackdropImageTags { get; set; }
public List<string> ParentBackdropImageTags { get; set; }
/// <summary>
/// Gets or sets the local trailer count.
@@ -466,13 +466,13 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the album image tag.
/// </summary>
/// <value>The album image tag.</value>
public Guid? AlbumPrimaryImageTag { get; set; }
public string AlbumPrimaryImageTag { get; set; }
/// <summary>
/// Gets or sets the series primary image tag.
/// </summary>
/// <value>The series primary image tag.</value>
public Guid? SeriesPrimaryImageTag { get; set; }
public string SeriesPrimaryImageTag { get; set; }
/// <summary>
/// Gets or sets the album artist.
@@ -529,25 +529,25 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the image tags.
/// </summary>
/// <value>The image tags.</value>
public Dictionary<ImageType, Guid> ImageTags { get; set; }
public Dictionary<ImageType, string> ImageTags { get; set; }
/// <summary>
/// Gets or sets the backdrop image tags.
/// </summary>
/// <value>The backdrop image tags.</value>
public List<Guid> BackdropImageTags { get; set; }
public List<string> BackdropImageTags { get; set; }
/// <summary>
/// Gets or sets the screenshot image tags.
/// </summary>
/// <value>The screenshot image tags.</value>
public List<Guid> ScreenshotImageTags { get; set; }
public List<string> ScreenshotImageTags { get; set; }
/// <summary>
/// Gets or sets the parent logo image tag.
/// </summary>
/// <value>The parent logo image tag.</value>
public Guid? ParentLogoImageTag { get; set; }
public string ParentLogoImageTag { get; set; }
/// <summary>
/// If the item does not have a art, this will hold the Id of the Parent that has one.
@@ -559,13 +559,13 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the parent art image tag.
/// </summary>
/// <value>The parent art image tag.</value>
public Guid? ParentArtImageTag { get; set; }
public string ParentArtImageTag { get; set; }
/// <summary>
/// Gets or sets the series thumb image tag.
/// </summary>
/// <value>The series thumb image tag.</value>
public Guid? SeriesThumbImageTag { get; set; }
public string SeriesThumbImageTag { get; set; }
/// <summary>
/// Gets or sets the series studio.
@@ -583,7 +583,7 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the parent thumb image tag.
/// </summary>
/// <value>The parent thumb image tag.</value>
public Guid? ParentThumbImageTag { get; set; }
public string ParentThumbImageTag { get; set; }
/// <summary>
/// Gets or sets the chapters.

View File

@@ -33,7 +33,7 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the primary image tag.
/// </summary>
/// <value>The primary image tag.</value>
public Guid? PrimaryImageTag { get; set; }
public string PrimaryImageTag { get; set; }
/// <summary>
/// Gets a value indicating whether this instance has primary image.
@@ -44,7 +44,7 @@ namespace MediaBrowser.Model.Dto
{
get
{
return PrimaryImageTag.HasValue;
return PrimaryImageTag != null;
}
}

View File

@@ -27,7 +27,7 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the image tag.
/// </summary>
/// <value>The image tag.</value>
public Guid? ImageTag { get; set; }
public string ImageTag { get; set; }
/// <summary>
/// Gets a value indicating whether this instance has image.
@@ -36,7 +36,7 @@ namespace MediaBrowser.Model.Dto
[IgnoreDataMember]
public bool HasImage
{
get { return ImageTag.HasValue; }
get { return ImageTag != null; }
}
public event PropertyChangedEventHandler PropertyChanged;

View File

@@ -23,7 +23,7 @@ namespace MediaBrowser.Model.Dto
/// <summary>
/// The image tag
/// </summary>
public Guid ImageTag;
public string ImageTag;
/// <summary>
/// Gets or sets the path.

View File

@@ -56,7 +56,7 @@ namespace MediaBrowser.Model.Dto
/// If set this will result in strong, unconditional response caching
/// </summary>
/// <value>The hash.</value>
public Guid? Tag { get; set; }
public string Tag { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [crop whitespace].

View File

@@ -7,7 +7,7 @@ namespace MediaBrowser.Model.Dto
/// </summary>
public class ItemByNameCounts
{
public Guid UserId { get; set; }
public string UserId { get; set; }
/// <summary>
/// Gets or sets the total count.

View File

@@ -21,7 +21,7 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the primary image tag.
/// </summary>
/// <value>The primary image tag.</value>
public Guid? PrimaryImageTag { get; set; }
public string PrimaryImageTag { get; set; }
/// <summary>
/// Gets a value indicating whether this instance has primary image.
@@ -32,7 +32,7 @@ namespace MediaBrowser.Model.Dto
{
get
{
return PrimaryImageTag.HasValue;
return PrimaryImageTag != null;
}
}

View File

@@ -28,7 +28,7 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the primary image tag.
/// </summary>
/// <value>The primary image tag.</value>
public Guid? PrimaryImageTag { get; set; }
public string PrimaryImageTag { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance has password.
@@ -73,7 +73,7 @@ namespace MediaBrowser.Model.Dto
[IgnoreDataMember]
public bool HasPrimaryImage
{
get { return PrimaryImageTag.HasValue; }
get { return PrimaryImageTag != null; }
}
/// <summary>

View File

@@ -46,7 +46,7 @@ namespace MediaBrowser.Model.Entities
/// Gets or sets the primary image tag.
/// </summary>
/// <value>The primary image tag.</value>
public Guid? PrimaryImageTag { get; set; }
public string PrimaryImageTag { get; set; }
/// <summary>
/// Gets or sets the primary image item identifier.
@@ -58,7 +58,7 @@ namespace MediaBrowser.Model.Entities
/// Gets or sets the logo image tag.
/// </summary>
/// <value>The logo image tag.</value>
public Guid? LogoImageTag { get; set; }
public string LogoImageTag { get; set; }
/// <summary>
/// Gets or sets the logo item identifier.
@@ -70,7 +70,7 @@ namespace MediaBrowser.Model.Entities
/// Gets or sets the thumb image tag.
/// </summary>
/// <value>The thumb image tag.</value>
public Guid? ThumbImageTag { get; set; }
public string ThumbImageTag { get; set; }
/// <summary>
/// Gets or sets the thumb item identifier.
@@ -82,7 +82,7 @@ namespace MediaBrowser.Model.Entities
/// Gets or sets the thumb image tag.
/// </summary>
/// <value>The thumb image tag.</value>
public Guid? BackdropImageTag { get; set; }
public string BackdropImageTag { get; set; }
/// <summary>
/// Gets or sets the thumb item identifier.
@@ -163,7 +163,7 @@ namespace MediaBrowser.Model.Entities
[IgnoreDataMember]
public bool HasPrimaryImage
{
get { return PrimaryImageTag.HasValue; }
get { return PrimaryImageTag != null; }
}
public BaseItemInfo()

View File

@@ -36,7 +36,7 @@ namespace MediaBrowser.Model.Entities
/// Gets or sets the user id.
/// </summary>
/// <value>The user id.</value>
public Guid Id { get; set; }
public string Id { get; set; }
/// <summary>
/// Gets or sets the type of the view.
/// </summary>
@@ -105,7 +105,7 @@ namespace MediaBrowser.Model.Entities
{
var newWidth = PrimaryImageWidth / ImageScale;
var size = DrawingUtils.Resize(PrimaryImageWidth, PrimaryImageHeight, newWidth);
var size = DrawingUtils.Resize(PrimaryImageWidth, PrimaryImageHeight, newWidth, null, null, null);
PrimaryImageWidth = Convert.ToInt32(size.Width);
PrimaryImageHeight = Convert.ToInt32(size.Height);

View File

@@ -12,41 +12,41 @@ namespace MediaBrowser.Model.Entities
/// Gets or sets the folders added to.
/// </summary>
/// <value>The folders added to.</value>
public List<Guid> FoldersAddedTo { get; set; }
public List<string> FoldersAddedTo { get; set; }
/// <summary>
/// Gets or sets the folders removed from.
/// </summary>
/// <value>The folders removed from.</value>
public List<Guid> FoldersRemovedFrom { get; set; }
public List<string> FoldersRemovedFrom { get; set; }
/// <summary>
/// Gets or sets the items added.
/// </summary>
/// <value>The items added.</value>
public List<Guid> ItemsAdded { get; set; }
public List<string> ItemsAdded { get; set; }
/// <summary>
/// Gets or sets the items removed.
/// </summary>
/// <value>The items removed.</value>
public List<Guid> ItemsRemoved { get; set; }
public List<string> ItemsRemoved { get; set; }
/// <summary>
/// Gets or sets the items updated.
/// </summary>
/// <value>The items updated.</value>
public List<Guid> ItemsUpdated { get; set; }
public List<string> ItemsUpdated { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="LibraryUpdateInfo"/> class.
/// </summary>
public LibraryUpdateInfo()
{
FoldersAddedTo = new List<Guid>();
FoldersRemovedFrom = new List<Guid>();
ItemsAdded = new List<Guid>();
ItemsRemoved = new List<Guid>();
ItemsUpdated = new List<Guid>();
FoldersAddedTo = new List<string>();
FoldersRemovedFrom = new List<string>();
ItemsAdded = new List<string>();
ItemsRemoved = new List<string>();
ItemsUpdated = new List<string>();
}
}
}

View File

@@ -0,0 +1,17 @@
using System;
namespace MediaBrowser.Model.Events
{
/// <summary>
/// Provides a generic EventArgs subclass that can hold any kind of object
/// </summary>
/// <typeparam name="T"></typeparam>
public class GenericEventArgs<T> : EventArgs
{
/// <summary>
/// Gets or sets the argument.
/// </summary>
/// <value>The argument.</value>
public T Argument { get; set; }
}
}

View File

@@ -39,7 +39,7 @@ namespace MediaBrowser.Model.LiveTv
/// Gets or sets the image tags.
/// </summary>
/// <value>The image tags.</value>
public Dictionary<ImageType, Guid> ImageTags { get; set; }
public Dictionary<ImageType, string> ImageTags { get; set; }
/// <summary>
/// Gets or sets the number.
@@ -113,7 +113,7 @@ namespace MediaBrowser.Model.LiveTv
public ChannelInfoDto()
{
ImageTags = new Dictionary<ImageType, Guid>();
ImageTags = new Dictionary<ImageType, string>();
MediaSources = new List<MediaSourceInfo>();
}

View File

@@ -45,7 +45,7 @@ namespace MediaBrowser.Model.LiveTv
/// Gets or sets the channel primary image tag.
/// </summary>
/// <value>The channel primary image tag.</value>
public Guid? ChannelPrimaryImageTag { get; set; }
public string ChannelPrimaryImageTag { get; set; }
/// <summary>
/// Gets or sets the play access.
@@ -136,7 +136,7 @@ namespace MediaBrowser.Model.LiveTv
/// Gets or sets the image tags.
/// </summary>
/// <value>The image tags.</value>
public Dictionary<ImageType, Guid> ImageTags { get; set; }
public Dictionary<ImageType, string> ImageTags { get; set; }
/// <summary>
/// Gets or sets the user data.
@@ -211,7 +211,7 @@ namespace MediaBrowser.Model.LiveTv
public ProgramInfoDto()
{
Genres = new List<string>();
ImageTags = new Dictionary<ImageType, Guid>();
ImageTags = new Dictionary<ImageType, string>();
}
public event PropertyChangedEventHandler PropertyChanged;

View File

@@ -50,7 +50,7 @@ namespace MediaBrowser.Model.LiveTv
/// Gets or sets the channel primary image tag.
/// </summary>
/// <value>The channel primary image tag.</value>
public Guid? ChannelPrimaryImageTag { get; set; }
public string ChannelPrimaryImageTag { get; set; }
/// <summary>
/// ChannelName of the recording.
@@ -224,7 +224,7 @@ namespace MediaBrowser.Model.LiveTv
/// Gets or sets the image tags.
/// </summary>
/// <value>The image tags.</value>
public Dictionary<ImageType, Guid> ImageTags { get; set; }
public Dictionary<ImageType, string> ImageTags { get; set; }
/// <summary>
/// Gets or sets the user data.
@@ -253,7 +253,7 @@ namespace MediaBrowser.Model.LiveTv
public RecordingInfoDto()
{
Genres = new List<string>();
ImageTags = new Dictionary<ImageType, Guid>();
ImageTags = new Dictionary<ImageType, string>();
MediaSources = new List<MediaSourceInfo>();
}

View File

@@ -43,7 +43,7 @@ namespace MediaBrowser.Model.LiveTv
/// Gets or sets the image tags.
/// </summary>
/// <value>The image tags.</value>
public Dictionary<ImageType, Guid> ImageTags { get; set; }
public Dictionary<ImageType, string> ImageTags { get; set; }
/// <summary>
/// Gets a value indicating whether this instance has primary image.
@@ -57,7 +57,7 @@ namespace MediaBrowser.Model.LiveTv
public SeriesTimerInfoDto()
{
ImageTags = new Dictionary<ImageType, Guid>();
ImageTags = new Dictionary<ImageType, string>();
Days = new List<DayOfWeek>();
}
}

View File

@@ -97,6 +97,7 @@
<Compile Include="Dto\RecommendationDto.cs" />
<Compile Include="Dto\MediaVersionInfo.cs" />
<Compile Include="Entities\PackageReviewInfo.cs" />
<Compile Include="Events\GenericEventArgs.cs" />
<Compile Include="FileOrganization\FileOrganizationResult.cs" />
<Compile Include="FileOrganization\FileOrganizationQuery.cs" />
<Compile Include="Library\PlayAccess.cs" />

View File

@@ -47,13 +47,13 @@ namespace MediaBrowser.Model.Search
/// Gets or sets the image tag.
/// </summary>
/// <value>The image tag.</value>
public Guid? PrimaryImageTag { get; set; }
public string PrimaryImageTag { get; set; }
/// <summary>
/// Gets or sets the thumb image tag.
/// </summary>
/// <value>The thumb image tag.</value>
public Guid? ThumbImageTag { get; set; }
public string ThumbImageTag { get; set; }
/// <summary>
/// Gets or sets the thumb image item identifier.
@@ -65,7 +65,7 @@ namespace MediaBrowser.Model.Search
/// Gets or sets the backdrop image tag.
/// </summary>
/// <value>The backdrop image tag.</value>
public Guid? BackdropImageTag { get; set; }
public string BackdropImageTag { get; set; }
/// <summary>
/// Gets or sets the backdrop image item identifier.

View File

@@ -49,6 +49,7 @@ namespace MediaBrowser.Model.Session
SetSubtitleStreamIndex = 24,
ToggleFullscreen = 25,
DisplayContent = 26,
GoToSearch = 27
GoToSearch = 27,
DisplayMessage = 28
}
}

View File

@@ -55,7 +55,7 @@ namespace MediaBrowser.Model.Session
/// Gets or sets the user primary image tag.
/// </summary>
/// <value>The user primary image tag.</value>
public Guid? UserPrimaryImageTag { get; set; }
public string UserPrimaryImageTag { get; set; }
/// <summary>
/// Gets or sets the name of the user.

View File

@@ -30,7 +30,7 @@ namespace MediaBrowser.Model.Tasks
/// Gets or sets the id.
/// </summary>
/// <value>The id.</value>
public Guid Id { get; set; }
public string Id { get; set; }
/// <summary>
/// Gets or sets the last execution result.

View File

@@ -35,7 +35,7 @@ namespace MediaBrowser.Model.Tasks
/// Gets or sets the id.
/// </summary>
/// <value>The id.</value>
public Guid Id { get; set; }
public string Id { get; set; }
/// <summary>
/// Gets or sets the error message.

View File

@@ -11,7 +11,7 @@ namespace MediaBrowser.Model.Updates
/// Gets or sets the id.
/// </summary>
/// <value>The id.</value>
public Guid Id { get; set; }
public string Id { get; set; }
/// <summary>
/// Gets or sets the name.

View File

@@ -47,7 +47,7 @@ namespace MediaBrowser.Model.Updates
/// <param name="str">The STR.</param>
/// <param name="def">The def.</param>
/// <returns>System.String.</returns>
private static string ValueOrDefault(string str, string def = "")
private static string ValueOrDefault(string str, string def)
{
return string.IsNullOrEmpty(str) ? def : str;
}
@@ -80,7 +80,7 @@ namespace MediaBrowser.Model.Updates
/// Gets or sets the source URL.
/// </summary>
/// <value>The source URL.</value>
public Guid checksum { get; set; }
public string checksum { get; set; }
/// <summary>
/// Gets or sets the target filename.

View File

@@ -122,50 +122,6 @@ namespace MediaBrowser.Model.Web
}
}
/// <summary>
/// Adds the specified name.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="value">The value.</param>
/// <exception cref="System.ArgumentNullException">value</exception>
public void Add(string name, Guid value)
{
if (value == Guid.Empty)
{
throw new ArgumentNullException("value");
}
Add(name, value.ToString());
}
/// <summary>
/// Adds if not empty.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="value">The value.</param>
public void AddIfNotEmpty(string name, Guid value)
{
if (value != Guid.Empty)
{
Add(name, value);
}
Add(name, value);
}
/// <summary>
/// Adds if not null.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="value">The value.</param>
public void AddIfNotNull(string name, Guid? value)
{
if (value.HasValue)
{
Add(name, value.Value);
}
}
/// <summary>
/// Adds the specified name.
/// </summary>