Skip to content

Commit

Permalink
Post GPL cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Bond-009 committed Jan 3, 2019
1 parent 1555364 commit 41a92e4
Show file tree
Hide file tree
Showing 99 changed files with 323 additions and 1,049 deletions.
1 change: 0 additions & 1 deletion Emby.Server.Implementations/Library/UserManager.cs
Expand Up @@ -2,7 +2,6 @@
using MediaBrowser.Common.Net;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Connect;
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
Expand Down
3 changes: 1 addition & 2 deletions MediaBrowser.Api/BaseApiService.cs
Expand Up @@ -55,12 +55,11 @@ public string GetHeader(string name)
return Request.Headers[name];
}

private static readonly string[] EmptyStringArray = Array.Empty<string>();
public static string[] SplitValue(string value, char delim)
{
if (string.IsNullOrWhiteSpace(value))
{
return EmptyStringArray;
return Array.Empty<string>();
}

return value.Split(new[] { delim }, StringSplitOptions.RemoveEmptyEntries);
Expand Down
5 changes: 2 additions & 3 deletions MediaBrowser.Api/UserService.cs
@@ -1,4 +1,5 @@
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Authentication;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Devices;
Expand All @@ -10,11 +11,9 @@
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Users;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using MediaBrowser.Model.Services;
using MediaBrowser.Controller.Authentication;

namespace MediaBrowser.Api
{
Expand Down
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Threading.Tasks;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Users;

Expand Down
7 changes: 0 additions & 7 deletions MediaBrowser.Controller/Chapters/IChapterManager.cs
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using MediaBrowser.Model.Entities;

namespace MediaBrowser.Controller.Chapters
Expand All @@ -9,12 +8,6 @@ namespace MediaBrowser.Controller.Chapters
/// </summary>
public interface IChapterManager
{
/// <summary>
/// Gets the chapters.
/// </summary>
/// <param name="itemId">The item identifier.</param>
/// <returns>List{ChapterInfo}.</returns>

/// <summary>
/// Saves the chapters.
/// </summary>
Expand Down
Expand Up @@ -20,8 +20,8 @@ public class CollectionCreationOptions : IHasProviderIds
public CollectionCreationOptions()
{
ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
ItemIdList = new string[] {};
UserIds = new Guid[] {};
ItemIdList = Array.Empty<string>();
UserIds = Array.Empty<Guid>();
}
}
}
45 changes: 0 additions & 45 deletions MediaBrowser.Controller/Connect/IConnectManager.cs

This file was deleted.

1 change: 0 additions & 1 deletion MediaBrowser.Controller/Dto/IDtoService.cs
Expand Up @@ -2,7 +2,6 @@
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Querying;
using System.Collections.Generic;
using MediaBrowser.Controller.Sync;

namespace MediaBrowser.Controller.Dto
{
Expand Down
2 changes: 1 addition & 1 deletion MediaBrowser.Controller/Entities/AggregateFolder.cs
Expand Up @@ -20,7 +20,7 @@ public class AggregateFolder : Folder
{
public AggregateFolder()
{
PhysicalLocationsList = new string[] { };
PhysicalLocationsList = Array.Empty<string>();
}

[IgnoreDataMember]
Expand Down
9 changes: 2 additions & 7 deletions MediaBrowser.Controller/Entities/Audio/Audio.cs
Expand Up @@ -2,13 +2,8 @@
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.MediaInfo;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Model.Serialization;

Expand Down Expand Up @@ -36,8 +31,8 @@ public class Audio : BaseItem,

public Audio()
{
Artists = new string[] {};
AlbumArtists = new string[] {};
Artists = Array.Empty<string>();
AlbumArtists = Array.Empty<string>();
}

public override double GetDefaultPrimaryImageAspectRatio()
Expand Down
4 changes: 2 additions & 2 deletions MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs
Expand Up @@ -23,8 +23,8 @@ public class MusicAlbum : Folder, IHasAlbumArtist, IHasArtist, IHasMusicGenres,

public MusicAlbum()
{
Artists = new string[] {};
AlbumArtists = new string[] {};
Artists = Array.Empty<string>();
AlbumArtists = Array.Empty<string>();
}

[IgnoreDataMember]
Expand Down
3 changes: 1 addition & 2 deletions MediaBrowser.Controller/Entities/Audio/MusicArtist.cs
Expand Up @@ -129,13 +129,12 @@ public override bool IsSaveLocalMetadataEnabled()
return base.IsSaveLocalMetadataEnabled();
}

private readonly Task _cachedTask = Task.FromResult(true);
protected override Task ValidateChildrenInternal(IProgress<double> progress, CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService)
{
if (IsAccessedByName)
{
// Should never get in here anyway
return _cachedTask;
return Task.CompletedTask;
}

return base.ValidateChildrenInternal(progress, cancellationToken, recursive, refreshChildMetadata, refreshOptions, directoryService);
Expand Down
40 changes: 23 additions & 17 deletions MediaBrowser.Controller/Entities/BaseItem.cs
Expand Up @@ -35,24 +35,24 @@ namespace MediaBrowser.Controller.Entities
/// </summary>
public abstract class BaseItem : IHasProviderIds, IHasLookupInfo<ItemLookupInfo>
{
protected static MetadataFields[] EmptyMetadataFieldsArray = new MetadataFields[] { };
protected static MediaUrl[] EmptyMediaUrlArray = new MediaUrl[] { };
protected static ItemImageInfo[] EmptyItemImageInfoArray = new ItemImageInfo[] { };
public static readonly LinkedChild[] EmptyLinkedChildArray = new LinkedChild[] { };
protected static MetadataFields[] EmptyMetadataFieldsArray = Array.Empty<MetadataFields>();
protected static MediaUrl[] EmptyMediaUrlArray = Array.Empty<MediaUrl>();
protected static ItemImageInfo[] EmptyItemImageInfoArray = Array.Empty<ItemImageInfo>();
public static readonly LinkedChild[] EmptyLinkedChildArray = Array.Empty<LinkedChild>();

protected BaseItem()
{
ThemeSongIds = new Guid[] {};
ThemeVideoIds = new Guid[] {};
Tags = new string[] {};
Genres = new string[] {};
Studios = new string[] {};
ThemeSongIds = Array.Empty<Guid>();
ThemeVideoIds = Array.Empty<Guid>();
Tags = Array.Empty<string>();
Genres = Array.Empty<string>();
Studios = Array.Empty<string>();
ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
LockedFields = EmptyMetadataFieldsArray;
ImageInfos = EmptyItemImageInfoArray;
ProductionLocations = new string[] {};
RemoteTrailers = new MediaUrl[] { };
ExtraIds = new Guid[] {};
ProductionLocations = Array.Empty<string>();
RemoteTrailers = Array.Empty<MediaUrl>();
ExtraIds = Array.Empty<Guid>();
}

public static readonly char[] SlugReplaceChars = { '?', '/', '&' };
Expand All @@ -62,7 +62,6 @@ protected BaseItem()
/// The supported image extensions
/// </summary>
public static readonly string[] SupportedImageExtensions = { ".png", ".jpg", ".jpeg", ".tbn", ".gif" };
public static readonly List<string> SupportedImageExtensionsList = SupportedImageExtensions.ToList();

/// <summary>
/// The trailer folder name
Expand Down Expand Up @@ -2895,6 +2894,10 @@ public IEnumerable<BaseItem> GetThemeVideos()
return ThemeVideoIds.Select(LibraryManager.GetItemById).Where(i => i.ExtraType.Equals(Model.Entities.ExtraType.ThemeVideo)).OrderBy(i => i.SortName);
}

/// <summary>
/// Gets or sets the remote trailers.
/// </summary>
/// <value>The remote trailers.</value>
public MediaUrl[] RemoteTrailers { get; set; }

public IEnumerable<BaseItem> GetExtras()
Expand All @@ -2913,21 +2916,24 @@ public IEnumerable<BaseItem> GetDisplayExtras()
}

public virtual bool IsHD {
get{
get
{
return Height >= 720;
}
}
}
public bool IsShortcut{ get; set;}
public string ShortcutPath{ get; set;}
public int Width { get; set; }
public int Height { get; set; }
public Guid[] ExtraIds { get; set; }
public virtual long GetRunTimeTicksForPlayState() {
public virtual long GetRunTimeTicksForPlayState()
{
return RunTimeTicks ?? 0;
}
// what does this do?
public static ExtraType[] DisplayExtraTypes = new[] {Model.Entities.ExtraType.ThemeSong, Model.Entities.ExtraType.ThemeVideo };
public virtual bool SupportsExternalTransfer {
public virtual bool SupportsExternalTransfer
{
get {
return false;
}
Expand Down
14 changes: 3 additions & 11 deletions MediaBrowser.Controller/Entities/CollectionFolder.cs
Expand Up @@ -31,18 +31,10 @@ public class CollectionFolder : Folder, ICollectionFolder

public CollectionFolder()
{
PhysicalLocationsList = new string[] { };
PhysicalFolderIds = new Guid[] { };
PhysicalLocationsList = Array.Empty<string>();
PhysicalFolderIds = Array.Empty<Guid>();
}

//public override double? GetDefaultPrimaryImageAspectRatio()
//{
// double value = 16;
// value /= 9;

// return value;
//}

[IgnoreDataMember]
public override bool SupportsPlayedStatus
{
Expand Down Expand Up @@ -339,7 +331,7 @@ private ItemResolveArgs CreateResolveArgs(IDirectoryService directoryService, bo
/// <returns>Task.</returns>
protected override Task ValidateChildrenInternal(IProgress<double> progress, CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService)
{
return Task.FromResult(true);
return Task.CompletedTask;
}

/// <summary>
Expand Down
12 changes: 3 additions & 9 deletions MediaBrowser.Controller/Entities/Game.cs
Expand Up @@ -12,10 +12,10 @@ public class Game : BaseItem, IHasTrailers, IHasScreenshots, ISupportsPlaceHolde
{
public Game()
{
MultiPartGameFiles = new string[] {};
MultiPartGameFiles = Array.Empty<string>();
RemoteTrailers = EmptyMediaUrlArray;
LocalTrailerIds = new Guid[] {};
RemoteTrailerIds = new Guid[] {};
LocalTrailerIds = Array.Empty<Guid>();
RemoteTrailerIds = Array.Empty<Guid>();
}

public Guid[] LocalTrailerIds { get; set; }
Expand All @@ -38,12 +38,6 @@ public override bool SupportsPeople
get { return false; }
}

/// <summary>
/// Gets or sets the remote trailers.
/// </summary>
/// <value>The remote trailers.</value>
public MediaUrl[] RemoteTrailers { get; set; }

/// <summary>
/// Gets the type of the media.
/// </summary>
Expand Down

0 comments on commit 41a92e4

Please sign in to comment.