update translations

This commit is contained in:
Luke Pulverenti
2014-06-29 15:59:52 -04:00
parent b87f759460
commit 1a5a75854b
50 changed files with 1276 additions and 212 deletions

View File

@@ -1,6 +1,5 @@
using MediaBrowser.Model.Weather;
using System;
using System.Collections.Generic;
namespace MediaBrowser.Model.Configuration
{
@@ -275,14 +274,13 @@ namespace MediaBrowser.Model.Configuration
UICulture = "en-us";
MetadataOptions = new List<MetadataOptions>
MetadataOptions = new[]
{
new MetadataOptions(1, 1280) {ItemType = "Book"},
new MetadataOptions(1, 1280) {ItemType = "MusicAlbum"},
new MetadataOptions(1, 1280) {ItemType = "MusicArtist"},
new MetadataOptions(0, 1280) {ItemType = "Season"}
}.ToArray();
};
NotificationOptions = new NotificationOptions();

View File

@@ -175,6 +175,35 @@ namespace MediaBrowser.Model.Dlna
return false;
}
private bool IsConditionSatisfied(ProfileCondition condition, float? currentValue)
{
if (!currentValue.HasValue)
{
// If the value is unknown, it satisfies if not marked as required
return !condition.IsRequired;
}
float expected;
if (FloatHelper.TryParseCultureInvariant(condition.Value, out expected))
{
switch (condition.Condition)
{
case ProfileConditionType.Equals:
return currentValue.Value.Equals(expected);
case ProfileConditionType.GreaterThanEqual:
return currentValue.Value >= expected;
case ProfileConditionType.LessThanEqual:
return currentValue.Value <= expected;
case ProfileConditionType.NotEquals:
return !currentValue.Value.Equals(expected);
default:
throw new InvalidOperationException("Unexpected ProfileConditionType");
}
}
return false;
}
private bool IsConditionSatisfied(ProfileCondition condition, double? currentValue)
{

View File

@@ -1,34 +0,0 @@
using System;
namespace MediaBrowser.Model.Dlna
{
public class EventSubscription
{
public string Id { get; set; }
public string CallbackUrl { get; set; }
public string NotificationType { get; set; }
public DateTime SubscriptionTime { get; set; }
public int TimeoutSeconds { get; set; }
public long TriggerCount { get; set; }
public void IncrementTriggerCount()
{
if (TriggerCount == long.MaxValue)
{
TriggerCount = 0;
}
TriggerCount++;
}
public bool IsExpired
{
get
{
return SubscriptionTime.AddSeconds(TimeoutSeconds) >= DateTime.UtcNow;
}
}
}
}

View File

@@ -1,35 +0,0 @@
using MediaBrowser.Model.Extensions;
using System;
using System.Collections.Generic;
namespace MediaBrowser.Model.Dlna
{
public class Filter
{
private readonly List<string> _fields;
private readonly bool _all;
public Filter()
: this("*")
{
}
public Filter(string filter)
{
_all = StringHelper.EqualsIgnoreCase(filter, "*");
List<string> list = new List<string>();
foreach (string s in (filter ?? string.Empty).Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries))
list.Add(s);
_fields = list;
}
public bool Contains(string field)
{
// Don't bother with this. Some clients (media monkey) use the filter and then don't display very well when very little data comes back.
return true;
//return _all || ListHelper.ContainsIgnoreCase(_fields, field);
}
}
}

View File

@@ -15,7 +15,7 @@ namespace MediaBrowser.Model.Dto
/// This holds information about a BaseItem in a format that is convenient for the client.
/// </summary>
[DebuggerDisplay("Name = {Name}, ID = {Id}, Type = {Type}")]
public class BaseItemDto : IHasProviderIds, INotifyPropertyChanged, IItemDto
public class BaseItemDto : IHasProviderIds, IHasPropertyChangedEvent, IItemDto
{
/// <summary>
/// Gets or sets the name.
@@ -844,7 +844,7 @@ namespace MediaBrowser.Model.Dto
[IgnoreDataMember]
public bool IsVideo
{
get { return StringHelper.EqualsIgnoreCase(MediaType, Entities.MediaType.Video); }
get { return StringHelper.EqualsIgnoreCase(MediaType, MediaBrowser.Model.Entities.MediaType.Video); }
}
/// <summary>
@@ -854,7 +854,7 @@ namespace MediaBrowser.Model.Dto
[IgnoreDataMember]
public bool IsAudio
{
get { return StringHelper.EqualsIgnoreCase(MediaType, Entities.MediaType.Audio); }
get { return StringHelper.EqualsIgnoreCase(MediaType, MediaBrowser.Model.Entities.MediaType.Audio); }
}
/// <summary>
@@ -864,7 +864,7 @@ namespace MediaBrowser.Model.Dto
[IgnoreDataMember]
public bool IsGame
{
get { return StringHelper.EqualsIgnoreCase(MediaType, Entities.MediaType.Game); }
get { return StringHelper.EqualsIgnoreCase(MediaType, MediaBrowser.Model.Entities.MediaType.Game); }
}
/// <summary>

View File

@@ -1,6 +1,7 @@
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.Serialization;
using MediaBrowser.Model.Extensions;
namespace MediaBrowser.Model.Dto
{
@@ -8,7 +9,7 @@ namespace MediaBrowser.Model.Dto
/// This is used by the api to get information about a Person within a BaseItem
/// </summary>
[DebuggerDisplay("Name = {Name}, Role = {Role}, Type = {Type}")]
public class BaseItemPerson : INotifyPropertyChanged
public class BaseItemPerson : IHasPropertyChangedEvent
{
/// <summary>
/// Gets or sets the name.

View File

@@ -1,6 +1,7 @@
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.Serialization;
using MediaBrowser.Model.Extensions;
namespace MediaBrowser.Model.Dto
{
@@ -8,7 +9,7 @@ namespace MediaBrowser.Model.Dto
/// Class ChapterInfo
/// </summary>
[DebuggerDisplay("Name = {Name}")]
public class ChapterInfoDto : INotifyPropertyChanged
public class ChapterInfoDto : IHasPropertyChangedEvent
{
/// <summary>
/// Gets or sets the start position ticks.

View File

@@ -3,6 +3,7 @@ using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.Serialization;
using MediaBrowser.Model.Extensions;
namespace MediaBrowser.Model.Dto
{
@@ -10,7 +11,7 @@ namespace MediaBrowser.Model.Dto
/// Class UserDto
/// </summary>
[DebuggerDisplay("Name = {Name}, ID = {Id}, HasPassword = {HasPassword}")]
public class UserDto : INotifyPropertyChanged, IItemDto
public class UserDto : IHasPropertyChangedEvent, IItemDto
{
/// <summary>
/// Gets or sets the name.

View File

@@ -1,12 +1,13 @@
using System;
using System.ComponentModel;
using MediaBrowser.Model.Extensions;
namespace MediaBrowser.Model.Dto
{
/// <summary>
/// Class UserItemDataDto
/// </summary>
public class UserItemDataDto : INotifyPropertyChanged
public class UserItemDataDto : IHasPropertyChangedEvent
{
/// <summary>
/// Gets or sets the rating.

View File

@@ -2,13 +2,14 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using MediaBrowser.Model.Extensions;
namespace MediaBrowser.Model.Entities
{
/// <summary>
/// Defines the display preferences for any item that supports them (usually Folders)
/// </summary>
public class DisplayPreferences : INotifyPropertyChanged
public class DisplayPreferences : IHasPropertyChangedEvent
{
/// <summary>
/// Occurs when [property changed].

View File

@@ -136,7 +136,7 @@ namespace MediaBrowser.Model.Entities
{
if (Type != MediaStreamType.Subtitle) return false;
var codec = Codec ?? string.Empty;
string codec = Codec ?? string.Empty;
return StringHelper.IndexOfIgnoreCase(codec, "pgs") == -1 &&
StringHelper.IndexOfIgnoreCase(codec, "dvd") == -1;

View File

@@ -0,0 +1,8 @@
using System.ComponentModel;
namespace MediaBrowser.Model.Extensions
{
public interface IHasPropertyChangedEvent : INotifyPropertyChanged
{
}
}

View File

@@ -6,7 +6,16 @@ namespace MediaBrowser.Model.Extensions
{
public static class ListHelper
{
public static bool ContainsIgnoreCase(IEnumerable<string> list, string value)
public static bool ContainsIgnoreCase(List<string> list, string value)
{
if (value == null)
{
throw new ArgumentNullException("value");
}
return list.Contains(value, StringComparer.OrdinalIgnoreCase);
}
public static bool ContainsIgnoreCase(string[] list, string value)
{
if (value == null)
{

View File

@@ -1,9 +1,10 @@
using System;
using System.ComponentModel;
using MediaBrowser.Model.Extensions;
namespace MediaBrowser.Model.LiveTv
{
public class BaseTimerInfoDto : INotifyPropertyChanged
public class BaseTimerInfoDto : IHasPropertyChangedEvent
{
/// <summary>
/// Occurs when a property value changes.

View File

@@ -1,5 +1,6 @@
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.Library;
using System.Collections.Generic;
using System.ComponentModel;
@@ -12,7 +13,7 @@ namespace MediaBrowser.Model.LiveTv
/// Class ChannelInfoDto
/// </summary>
[DebuggerDisplay("Name = {Name}, Number = {Number}")]
public class ChannelInfoDto : INotifyPropertyChanged, IItemDto
public class ChannelInfoDto : IHasPropertyChangedEvent, IItemDto
{
/// <summary>
/// Gets or sets the name.

View File

@@ -5,12 +5,13 @@ using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using System;
using System.Collections.Generic;
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.Library;
namespace MediaBrowser.Model.LiveTv
{
[DebuggerDisplay("Name = {Name}, StartTime = {StartDate}, EndTime = {EndDate}")]
public class ProgramInfoDto : INotifyPropertyChanged, IItemDto
public class ProgramInfoDto : IHasPropertyChangedEvent, IItemDto
{
/// <summary>
/// Id of the program.

View File

@@ -1,5 +1,6 @@
using System.ComponentModel;
using System.Diagnostics;
using MediaBrowser.Model.Extensions;
namespace MediaBrowser.Model.LiveTv
{
@@ -7,7 +8,7 @@ namespace MediaBrowser.Model.LiveTv
/// Class RecordingGroupDto.
/// </summary>
[DebuggerDisplay("Name = {Name}, Count = {RecordingCount}")]
public class RecordingGroupDto : INotifyPropertyChanged
public class RecordingGroupDto : IHasPropertyChangedEvent
{
/// <summary>
/// Gets or sets the name.

View File

@@ -1,5 +1,6 @@
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.Library;
using System;
using System.Collections.Generic;
@@ -10,7 +11,7 @@ using System.Runtime.Serialization;
namespace MediaBrowser.Model.LiveTv
{
[DebuggerDisplay("Name = {Name}, ChannelName = {ChannelName}")]
public class RecordingInfoDto : INotifyPropertyChanged, IItemDto
public class RecordingInfoDto : IHasPropertyChangedEvent, IItemDto
{
/// <summary>
/// Id of the recording.

View File

@@ -109,8 +109,6 @@
<Compile Include="Dlna\DlnaFlags.cs" />
<Compile Include="Dlna\DlnaMaps.cs" />
<Compile Include="Dlna\DlnaProfileType.cs" />
<Compile Include="Dlna\EventSubscription.cs" />
<Compile Include="Dlna\Filter.cs" />
<Compile Include="Dlna\HeaderMatchType.cs" />
<Compile Include="Dlna\HttpHeaderInfo.cs" />
<Compile Include="Dlna\MediaFormatProfile.cs" />
@@ -155,6 +153,7 @@
<Compile Include="Entities\VideoSize.cs" />
<Compile Include="Events\GenericEventArgs.cs" />
<Compile Include="Extensions\DoubleHelper.cs" />
<Compile Include="Extensions\IHasPropertyChangedEvent.cs" />
<Compile Include="Extensions\IntHelper.cs" />
<Compile Include="Extensions\ListHelper.cs" />
<Compile Include="Extensions\StringHelper.cs" />

View File

@@ -1,6 +1,6 @@
using System;
using MediaBrowser.Model.Configuration;
using System;
using System.Collections.Generic;
using MediaBrowser.Model.Configuration;
namespace MediaBrowser.Model.Notifications
{
@@ -34,7 +34,7 @@ namespace MediaBrowser.Model.Notifications
UserIds = new List<string>();
Date = DateTime.UtcNow;
Variables = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
Variables = new Dictionary<string, string>();
ExcludeUserIds = new List<string>();
}

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
namespace MediaBrowser.Model.Session
{
@@ -13,7 +12,7 @@ namespace MediaBrowser.Model.Session
public GeneralCommand()
{
Arguments = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
Arguments = new Dictionary<string, string>();
}
}
}

View File

@@ -3,11 +3,12 @@ using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using MediaBrowser.Model.Extensions;
namespace MediaBrowser.Model.Session
{
[DebuggerDisplay("Client = {Client}, Username = {UserName}")]
public class SessionInfoDto : INotifyPropertyChanged
public class SessionInfoDto : IHasPropertyChangedEvent
{
/// <summary>
/// Gets or sets a value indicating whether this instance can seek.

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
namespace MediaBrowser.Model.Themes
{
@@ -15,7 +14,7 @@ namespace MediaBrowser.Model.Themes
public AppTheme()
{
Options = new Dictionary<string, string>(StringComparer.Ordinal);
Options = new Dictionary<string, string>();
Images = new List<ThemeImage>();
}

View File

@@ -1,5 +1,4 @@
using System;

namespace MediaBrowser.Model.Updates
{
/// <summary>
@@ -17,9 +16,9 @@ namespace MediaBrowser.Model.Updates
/// Gets or sets the available version.
/// </summary>
/// <value>The available version.</value>
public Version AvailableVersion
public string AvailableVersion
{
get { return Package != null ? Package.version : new Version(0, 0); }
get { return Package != null ? Package.versionStr : "0.0.0.1"; }
set { } // need this for the serializer
}

View File

@@ -1,6 +1,4 @@
using System;
using System.Runtime.Serialization;

namespace MediaBrowser.Model.Updates
{
/// <summary>
@@ -26,32 +24,6 @@ namespace MediaBrowser.Model.Updates
/// <value>The version STR.</value>
public string versionStr { get; set; }
/// <summary>
/// The _version
/// </summary>
private Version _version;
/// <summary>
/// Gets or sets the version.
/// Had to make this an interpreted property since Protobuf can't handle Version
/// </summary>
/// <value>The version.</value>
[IgnoreDataMember]
public Version version
{
get { return _version ?? (_version = new Version(ValueOrDefault(versionStr, "0.0.0.1"))); }
}
/// <summary>
/// Values the or default.
/// </summary>
/// <param name="str">The STR.</param>
/// <param name="def">The def.</param>
/// <returns>System.String.</returns>
private static string ValueOrDefault(string str, string def)
{
return string.IsNullOrEmpty(str) ? def : str;
}
/// <summary>
/// Gets or sets the classification.
/// </summary>