Skip to content

Commit 5888e02

Browse files
Merge pull request #3242 from MediaBrowser/dev
update translations
2 parents 364370f + 1863407 commit 5888e02

File tree

133 files changed

+1472
-2286
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+1472
-2286
lines changed

Emby.Dlna/Common/StateVariable.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Collections.Generic;
2+
using System;
23

34
namespace Emby.Dlna.Common
45
{
@@ -10,7 +11,7 @@ public class StateVariable
1011

1112
public bool SendsEvents { get; set; }
1213

13-
public List<string> AllowedValues { get; set; }
14+
public string[] AllowedValues { get; set; }
1415

1516
public override string ToString()
1617
{
@@ -19,7 +20,7 @@ public override string ToString()
1920

2021
public StateVariable()
2122
{
22-
AllowedValues = new List<string>();
23+
AllowedValues = Array.Empty<string>();
2324
}
2425
}
2526
}

Emby.Dlna/ConfigurationExtension.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class DlnaConfigurationFactory : IConfigurationFactory
1616
{
1717
public IEnumerable<ConfigurationStore> GetConfigurations()
1818
{
19-
return new List<ConfigurationStore>
19+
return new ConfigurationStore[]
2020
{
2121
new ConfigurationStore
2222
{

Emby.Dlna/ConnectionManager/ConnectionManagerXmlBuilder.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ private IEnumerable<StateVariable> GetStateVariables()
4242
DataType = "string",
4343
SendsEvents = false,
4444

45-
AllowedValues = new List<string>
45+
AllowedValues = new string[]
4646
{
4747
"OK",
4848
"ContentFormatMismatch",
@@ -65,7 +65,7 @@ private IEnumerable<StateVariable> GetStateVariables()
6565
DataType = "string",
6666
SendsEvents = false,
6767

68-
AllowedValues = new List<string>
68+
AllowedValues = new string[]
6969
{
7070
"Output",
7171
"Input"

Emby.Dlna/ContentDirectory/ContentDirectoryXmlBuilder.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ private IEnumerable<StateVariable> GetStateVariables()
9999
DataType = "string",
100100
SendsEvents = false,
101101

102-
AllowedValues = new List<string>
102+
AllowedValues = new string[]
103103
{
104104
"BrowseMetadata",
105105
"BrowseDirectChildren"

Emby.Dlna/ContentDirectory/ControlHandler.cs

+8-8
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ private IEnumerable<KeyValuePair<string, string>> HandleBrowse(IDictionary<strin
311311

312312
var resXML = builder.ToString();
313313

314-
return new List<KeyValuePair<string, string>>
314+
return new []
315315
{
316316
new KeyValuePair<string,string>("Result", resXML),
317317
new KeyValuePair<string,string>("NumberReturned", provided.ToString(_usCulture)),
@@ -1135,7 +1135,7 @@ private QueryResult<ServerItem> GetMusicLatest(BaseItem parent, User user, Inter
11351135
ParentId = parent == null ? null : parent.Id.ToString("N"),
11361136
GroupItems = true
11371137

1138-
}, query.DtoOptions).Select(i => i.Item1 ?? i.Item2.FirstOrDefault()).Where(i => i != null).ToList();
1138+
}, query.DtoOptions).Select(i => i.Item1 ?? i.Item2.FirstOrDefault()).Where(i => i != null).ToArray();
11391139

11401140
return ToResult(items);
11411141
}
@@ -1150,7 +1150,7 @@ private QueryResult<ServerItem> GetNextUp(BaseItem parent, User user, InternalIt
11501150
StartIndex = query.StartIndex,
11511151
UserId = query.User.Id.ToString("N")
11521152

1153-
}, new List<BaseItem> { parent }, query.DtoOptions);
1153+
}, new [] { parent }, query.DtoOptions);
11541154

11551155
return ToResult(result);
11561156
}
@@ -1167,7 +1167,7 @@ private QueryResult<ServerItem> GetTvLatest(BaseItem parent, User user, Internal
11671167
ParentId = parent == null ? null : parent.Id.ToString("N"),
11681168
GroupItems = false
11691169

1170-
}, query.DtoOptions).Select(i => i.Item1 ?? i.Item2.FirstOrDefault()).Where(i => i != null).ToList();
1170+
}, query.DtoOptions).Select(i => i.Item1 ?? i.Item2.FirstOrDefault()).Where(i => i != null).ToArray();
11711171

11721172
return ToResult(items);
11731173
}
@@ -1184,7 +1184,7 @@ private QueryResult<ServerItem> GetMovieLatest(BaseItem parent, User user, Inter
11841184
ParentId = parent == null ? null : parent.Id.ToString("N"),
11851185
GroupItems = true
11861186

1187-
}, query.DtoOptions).Select(i => i.Item1 ?? i.Item2.FirstOrDefault()).Where(i => i != null).ToList();
1187+
}, query.DtoOptions).Select(i => i.Item1 ?? i.Item2.FirstOrDefault()).Where(i => i != null).ToArray();
11881188

11891189
return ToResult(items);
11901190
}
@@ -1249,15 +1249,15 @@ private QueryResult<ServerItem> GetMusicGenreItems(BaseItem item, Guid? parentId
12491249
return ToResult(result);
12501250
}
12511251

1252-
private QueryResult<ServerItem> ToResult(List<BaseItem> result)
1252+
private QueryResult<ServerItem> ToResult(BaseItem[] result)
12531253
{
12541254
var serverItems = result
12551255
.Select(i => new ServerItem(i))
1256-
.ToArray(result.Count);
1256+
.ToArray(result.Length);
12571257

12581258
return new QueryResult<ServerItem>
12591259
{
1260-
TotalRecordCount = result.Count,
1260+
TotalRecordCount = result.Length,
12611261
Items = serverItems
12621262
};
12631263
}

Emby.Dlna/ContentDirectory/ServiceActionListBuilder.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public class ServiceActionListBuilder
77
{
88
public IEnumerable<ServiceAction> GetActions()
99
{
10-
var list = new List<ServiceAction>
10+
return new []
1111
{
1212
GetSearchCapabilitiesAction(),
1313
GetSortCapabilitiesAction(),
@@ -18,8 +18,6 @@ public IEnumerable<ServiceAction> GetActions()
1818
GetXSetBookmarkAction(),
1919
GetBrowseByLetterAction()
2020
};
21-
22-
return list;
2321
}
2422

2523
private ServiceAction GetGetSystemUpdateIDAction()

Emby.Dlna/Main/DlnaEntryPoint.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ private async Task RegisterServerEndpoints()
248248
SetProperies(device, fullService);
249249
_Publisher.AddDevice(device);
250250

251-
var embeddedDevices = new List<string>
251+
var embeddedDevices = new []
252252
{
253253
"urn:schemas-upnp-org:service:ContentDirectory:1",
254254
"urn:schemas-upnp-org:service:ConnectionManager:1",

Emby.Dlna/MediaReceiverRegistrar/ServiceActionListBuilder.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public class ServiceActionListBuilder
77
{
88
public IEnumerable<ServiceAction> GetActions()
99
{
10-
var list = new List<ServiceAction>
10+
return new []
1111
{
1212
GetIsValidated(),
1313
GetIsAuthorized(),
@@ -17,8 +17,6 @@ public IEnumerable<ServiceAction> GetActions()
1717
GetGetValidationRevokedUpdateID(),
1818
GetGetValidationSucceededUpdateID()
1919
};
20-
21-
return list;
2220
}
2321

2422
private ServiceAction GetIsValidated()

Emby.Dlna/PlayTo/Device.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ private Task SetPlay(TransportCommands avCommands, CancellationToken cancellatio
368368
{
369369
var command = avCommands.ServiceActions.FirstOrDefault(c => c.Name == "Play");
370370
if (command == null)
371-
return Task.FromResult(true);
371+
return Task.CompletedTask;
372372

373373
var service = GetAvTransportService();
374374

Emby.Dlna/PlayTo/TransportCommands.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private static StateVariable FromXml(XElement container)
108108
{
109109
Name = container.GetValue(uPnpNamespaces.svc + "name"),
110110
DataType = container.GetValue(uPnpNamespaces.svc + "dataType"),
111-
AllowedValues = allowedValues
111+
AllowedValues = allowedValues.ToArray()
112112
};
113113
}
114114

Emby.Dlna/Service/ServiceXmlBuilder.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private void AppendServiceStateTable(StringBuilder builder, IEnumerable<StateVar
7272
builder.Append("<name>" + DescriptionXmlBuilder.Escape(item.Name ?? string.Empty) + "</name>");
7373
builder.Append("<dataType>" + DescriptionXmlBuilder.Escape(item.DataType ?? string.Empty) + "</dataType>");
7474

75-
if (item.AllowedValues.Count > 0)
75+
if (item.AllowedValues.Length > 0)
7676
{
7777
builder.Append("<allowedValueList>");
7878
foreach (var allowedValue in item.AllowedValues)

Emby.Drawing/ImageProcessor.cs

+15-10
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public async Task<Tuple<string, string, DateTime>> ProcessImage(ImageProcessingO
208208
dateModified = supportedImageInfo.Item2;
209209
var requiresTransparency = TransparentImageTypes.Contains(Path.GetExtension(originalImagePath) ?? string.Empty);
210210

211-
if (options.Enhancers.Count > 0)
211+
if (options.Enhancers.Length > 0)
212212
{
213213
if (item == null)
214214
{
@@ -541,7 +541,7 @@ public string GetImageCacheTag(BaseItem item, ItemImageInfo image)
541541
/// <param name="imageEnhancers">The image enhancers.</param>
542542
/// <returns>Guid.</returns>
543543
/// <exception cref="System.ArgumentNullException">item</exception>
544-
public string GetImageCacheTag(BaseItem item, ItemImageInfo image, List<IImageEnhancer> imageEnhancers)
544+
public string GetImageCacheTag(BaseItem item, ItemImageInfo image, IImageEnhancer[] imageEnhancers)
545545
{
546546
if (item == null)
547547
{
@@ -563,7 +563,7 @@ public string GetImageCacheTag(BaseItem item, ItemImageInfo image, List<IImageEn
563563
var imageType = image.Type;
564564

565565
// Optimization
566-
if (imageEnhancers.Count == 0)
566+
if (imageEnhancers.Length == 0)
567567
{
568568
return (originalImagePath + dateModified.Ticks).GetMD5().ToString("N");
569569
}
@@ -642,7 +642,7 @@ private async Task<Tuple<string, DateTime, bool>> GetEnhancedImage(ItemImageInfo
642642
bool inputImageSupportsTransparency,
643643
BaseItem item,
644644
int imageIndex,
645-
List<IImageEnhancer> enhancers,
645+
IImageEnhancer[] enhancers,
646646
CancellationToken cancellationToken)
647647
{
648648
var originalImagePath = image.Path;
@@ -693,7 +693,7 @@ private async Task<Tuple<string, bool>> GetEnhancedImageInternal(string original
693693
BaseItem item,
694694
ImageType imageType,
695695
int imageIndex,
696-
List<IImageEnhancer> supportedEnhancers,
696+
IImageEnhancer[] supportedEnhancers,
697697
string cacheGuid,
698698
CancellationToken cancellationToken)
699699
{
@@ -717,8 +717,8 @@ private async Task<Tuple<string, bool>> GetEnhancedImageInternal(string original
717717
}
718718

719719
// All enhanced images are saved as png to allow transparency
720-
var cacheExtension = _imageEncoder.SupportedOutputFormats.Contains(ImageFormat.Webp) ?
721-
".webp" :
720+
var cacheExtension = _imageEncoder.SupportedOutputFormats.Contains(ImageFormat.Webp) ?
721+
".webp" :
722722
(treatmentRequiresTransparency ? ".png" : ".jpg");
723723

724724
var enhancedImagePath = GetCachePath(EnhancedImageCachePath, cacheGuid + cacheExtension);
@@ -842,16 +842,20 @@ public void CreateImageCollage(ImageCollageOptions options)
842842
_logger.Info("Completed creation of image collage and saved to {0}", options.OutputPath);
843843
}
844844

845-
public List<IImageEnhancer> GetSupportedEnhancers(BaseItem item, ImageType imageType)
845+
public IImageEnhancer[] GetSupportedEnhancers(BaseItem item, ImageType imageType)
846846
{
847-
var list = new List<IImageEnhancer>();
847+
List<IImageEnhancer> list = null;
848848

849849
foreach (var i in ImageEnhancers)
850850
{
851851
try
852852
{
853853
if (i.Supports(item, imageType))
854854
{
855+
if (list == null)
856+
{
857+
list = new List<IImageEnhancer>();
858+
}
855859
list.Add(i);
856860
}
857861
}
@@ -860,7 +864,8 @@ public List<IImageEnhancer> GetSupportedEnhancers(BaseItem item, ImageType image
860864
_logger.ErrorException("Error in image enhancer: {0}", ex, i.GetType().Name);
861865
}
862866
}
863-
return list;
867+
868+
return list == null ? new IImageEnhancer[] { } : list.ToArray();
864869
}
865870

866871
private Dictionary<string, LockInfo> _locks = new Dictionary<string, LockInfo>();

Emby.Server.Implementations/ApplicationHost.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1552,9 +1552,7 @@ protected List<Tuple<Type, string>> GetTypes(Tuple<Assembly, string> assemblyInf
15521552

15531553
private IEnumerable<string> GetUrlPrefixes()
15541554
{
1555-
var hosts = new List<string>();
1556-
1557-
hosts.Add("+");
1555+
var hosts = new[] { "+" };
15581556

15591557
return hosts.SelectMany(i =>
15601558
{

Emby.Server.Implementations/Channels/ChannelManager.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,7 @@ private BaseItem GetChannelItemEntity(ChannelItemInfo info, IChannel channelProv
10651065
_logger.Debug("Forcing update due to TrailerTypes {0}", item.Name);
10661066
forceUpdate = true;
10671067
}
1068-
trailer.TrailerTypes = info.TrailerTypes;
1068+
trailer.TrailerTypes = info.TrailerTypes.ToArray();
10691069
}
10701070

10711071
if (info.DateModified > item.DateModified)

Emby.Server.Implementations/Data/SqliteItemRepository.cs

+2-20
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ private void SaveItem(BaseItem item, BaseItem topParent, string userDataKey, ISt
920920
}
921921

922922
var trailer = item as Trailer;
923-
if (trailer != null && trailer.TrailerTypes.Count > 0)
923+
if (trailer != null && trailer.TrailerTypes.Length > 0)
924924
{
925925
saveItemStatement.TryBind("@TrailerTypes", string.Join("|", trailer.TrailerTypes.Select(i => i.ToString()).ToArray()));
926926
}
@@ -1748,7 +1748,7 @@ private BaseItem GetItem(IReadOnlyList<IResultSetValue> reader, InternalItemsQue
17481748
}
17491749
return (TrailerType?)null;
17501750

1751-
}).Where(i => i.HasValue).Select(i => i.Value).ToList();
1751+
}).Where(i => i.HasValue).Select(i => i.Value).ToArray();
17521752
}
17531753
}
17541754
index++;
@@ -2017,24 +2017,6 @@ private Guid[] SplitToGuids(string value)
20172017
return result;
20182018
}
20192019

2020-
/// <summary>
2021-
/// Gets the critic reviews.
2022-
/// </summary>
2023-
/// <param name="itemId">The item id.</param>
2024-
public List<ItemReview> GetCriticReviews(Guid itemId)
2025-
{
2026-
return new List<ItemReview>();
2027-
}
2028-
2029-
/// <summary>
2030-
/// Saves the critic reviews.
2031-
/// </summary>
2032-
/// <param name="itemId">The item id.</param>
2033-
/// <param name="criticReviews">The critic reviews.</param>
2034-
public void SaveCriticReviews(Guid itemId, IEnumerable<ItemReview> criticReviews)
2035-
{
2036-
}
2037-
20382020
/// <summary>
20392021
/// Gets chapters for an item
20402022
/// </summary>

Emby.Server.Implementations/Devices/DeviceManager.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ public class DevicesConfigStore : IConfigurationFactory
437437
{
438438
public IEnumerable<ConfigurationStore> GetConfigurations()
439439
{
440-
return new List<ConfigurationStore>
440+
return new ConfigurationStore[]
441441
{
442442
new ConfigurationStore
443443
{

Emby.Server.Implementations/Dto/DtoService.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ private BaseItemDto GetBaseItemDtoInternal(BaseItem item, DtoOptions options, Li
267267
{
268268
if (fields.Contains(ItemFields.MediaSources))
269269
{
270-
dto.MediaSources = _mediaSourceManager().GetStaticMediaSources(item, true, user);
270+
dto.MediaSources = _mediaSourceManager().GetStaticMediaSources(item, true, user).ToArray();
271271

272272
NormalizeMediaSourceContainers(dto);
273273
}
@@ -1190,7 +1190,7 @@ private void AttachBasicFields(BaseItemDto dto, BaseItem item, BaseItem owner, D
11901190
{
11911191
MediaStream[] mediaStreams;
11921192

1193-
if (dto.MediaSources != null && dto.MediaSources.Count > 0)
1193+
if (dto.MediaSources != null && dto.MediaSources.Length > 0)
11941194
{
11951195
if (item.SourceType == SourceType.Channel)
11961196
{
@@ -1515,7 +1515,7 @@ public void AttachPrimaryImageAspectRatio(IItemDto dto, BaseItem item)
15151515

15161516
if (defaultAspectRatio.HasValue)
15171517
{
1518-
if (supportedEnhancers.Count == 0)
1518+
if (supportedEnhancers.Length == 0)
15191519
{
15201520
return defaultAspectRatio.Value;
15211521
}

Emby.Server.Implementations/Library/LibraryManager.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2596,7 +2596,7 @@ public IEnumerable<Video> FindTrailers(BaseItem owner, List<FileSystemMetadata>
25962596
// item is new
25972597
video.ExtraType = ExtraType.Trailer;
25982598
}
2599-
video.TrailerTypes = new List<TrailerType> { TrailerType.LocalTrailer };
2599+
video.TrailerTypes = new [] { TrailerType.LocalTrailer };
26002600

26012601
return video;
26022602

0 commit comments

Comments
 (0)