Skip to content

Commit

Permalink
separate player selection into it's own script
Browse files Browse the repository at this point in the history
  • Loading branch information
LukePulverenti committed Dec 29, 2016
1 parent 582f2e8 commit 25e26d2
Show file tree
Hide file tree
Showing 20 changed files with 703 additions and 312 deletions.
7 changes: 4 additions & 3 deletions Emby.Server.Implementations/IO/FileRefresher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,11 @@ private bool IsFileLocked(string path)
// In order to determine if the file is being written to, we have to request write access
// But if the server only has readonly access, this is going to cause this entire algorithm to fail
// So we'll take a best guess about our access level
var requestedFileAccess = ConfigurationManager.Configuration.SaveLocalMeta
? FileAccessMode.ReadWrite
: FileAccessMode.Read;
//var requestedFileAccess = ConfigurationManager.Configuration.SaveLocalMeta
// ? FileAccessMode.ReadWrite
// : FileAccessMode.Read;

var requestedFileAccess = FileAccessMode.Read;
try
{
using (_fileSystem.GetFileStream(path, FileOpenMode.Open, requestedFileAccess, FileShareMode.ReadWrite))
Expand Down
24 changes: 0 additions & 24 deletions Emby.Server.Implementations/Library/LibraryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1956,30 +1956,6 @@ public LibraryOptions GetLibraryOptions(BaseItem item)

var options = collectionFolder == null ? new LibraryOptions() : collectionFolder.GetLibraryOptions();

if (options.SchemaVersion < 3)
{
options.SaveLocalMetadata = ConfigurationManager.Configuration.SaveLocalMeta;
options.EnableInternetProviders = ConfigurationManager.Configuration.EnableInternetProviders;
}

if (options.SchemaVersion < 2)
{
var chapterOptions = ConfigurationManager.GetConfiguration<ChapterOptions>("chapters");
options.ExtractChapterImagesDuringLibraryScan = chapterOptions.ExtractDuringLibraryScan;

if (collectionFolder != null)
{
if (string.Equals(collectionFolder.CollectionType, "movies", StringComparison.OrdinalIgnoreCase))
{
options.EnableChapterImageExtraction = chapterOptions.EnableMovieChapterImageExtraction;
}
else if (string.Equals(collectionFolder.CollectionType, CollectionType.TvShows, StringComparison.OrdinalIgnoreCase))
{
options.EnableChapterImageExtraction = chapterOptions.EnableEpisodeChapterImageExtraction;
}
}
}

return options;
}

Expand Down
6 changes: 0 additions & 6 deletions MediaBrowser.Controller/Chapters/IChapterManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,5 @@ public interface IChapterManager
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task SaveChapters(string itemId, List<ChapterInfo> chapters, CancellationToken cancellationToken);

/// <summary>
/// Gets the configuration.
/// </summary>
/// <returns>ChapterOptions.</returns>
ChapterOptions GetConfiguration();
}
}
1 change: 0 additions & 1 deletion MediaBrowser.Controller/Entities/CollectionFolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ public static void SaveLibraryOptions(string path, LibraryOptions options)
{
LibraryOptions[path] = options;

options.SchemaVersion = 3;
XmlSerializer.SerializeToFile(options, GetLibraryOptionsPath(path));
}
}
Expand Down
11 changes: 0 additions & 11 deletions MediaBrowser.Model/Configuration/ChapterOptions.cs

This file was deleted.

1 change: 0 additions & 1 deletion MediaBrowser.Model/Configuration/LibraryOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ public class LibraryOptions
public bool EnableArchiveMediaFiles { get; set; }
public bool EnablePhotos { get; set; }
public bool EnableRealtimeMonitor { get; set; }
public int SchemaVersion { get; set; }
public bool EnableChapterImageExtraction { get; set; }
public bool ExtractChapterImagesDuringLibraryScan { get; set; }
public bool DownloadImagesInAdvance { get; set; }
Expand Down
14 changes: 0 additions & 14 deletions MediaBrowser.Model/Configuration/ServerConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ public class ServerConfiguration : BaseApplicationConfiguration
/// <value>The value pointing to the file system where the ssl certiifcate is located..</value>
public string CertificatePath { get; set; }

/// <summary>
/// Gets or sets a value indicating whether [enable internet providers].
/// </summary>
/// <value><c>true</c> if [enable internet providers]; otherwise, <c>false</c>.</value>
public bool EnableInternetProviders { get; set; }

/// <summary>
/// Gets or sets a value indicating whether this instance is port authorized.
/// </summary>
Expand Down Expand Up @@ -87,12 +81,6 @@ public class ServerConfiguration : BaseApplicationConfiguration
/// <value>The display name of the season zero.</value>
public string SeasonZeroDisplayName { get; set; }

/// <summary>
/// Gets or sets a value indicating whether [save local meta].
/// </summary>
/// <value><c>true</c> if [save local meta]; otherwise, <c>false</c>.</value>
public bool SaveLocalMeta { get; set; }

/// <summary>
/// Gets or sets the preferred metadata language.
/// </summary>
Expand Down Expand Up @@ -243,8 +231,6 @@ public ServerConfiguration()

LibraryMonitorDelay = 60;

EnableInternetProviders = true;

PathSubstitutions = new PathSubstitution[] { };
ContentTypes = new NameValuePair[] { };

Expand Down
1 change: 0 additions & 1 deletion MediaBrowser.Model/MediaBrowser.Model.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
<Compile Include="Collections\CollectionCreationResult.cs" />
<Compile Include="Configuration\AccessSchedule.cs" />
<Compile Include="Configuration\ChannelOptions.cs" />
<Compile Include="Configuration\ChapterOptions.cs" />
<Compile Include="Configuration\CinemaModeConfiguration.cs" />
<Compile Include="Configuration\EncodingOptions.cs" />
<Compile Include="Configuration\FanartOptions.cs" />
Expand Down
20 changes: 0 additions & 20 deletions MediaBrowser.Providers/Chapters/ChapterManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,5 @@ public Task SaveChapters(string itemId, List<ChapterInfo> chapters, Cancellation
{
return _itemRepo.SaveChapters(new Guid(itemId), chapters, cancellationToken);
}

public ChapterOptions GetConfiguration()
{
return _config.GetConfiguration<ChapterOptions>("chapters");
}
}

public class ChapterConfigurationStore : IConfigurationFactory
{
public IEnumerable<ConfigurationStore> GetConfigurations()
{
return new List<ConfigurationStore>
{
new ConfigurationStore
{
Key = "chapters",
ConfigurationType = typeof (ChapterOptions)
}
};
}
}
}
26 changes: 10 additions & 16 deletions MediaBrowser.Providers/Manager/ProviderManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -510,25 +510,19 @@ private void AddMetadataPlugins<T>(List<MetadataPlugin> list, T item, MetadataOp
Type = MetadataPluginType.LocalMetadataProvider
}));

if (item.IsInternetMetadataEnabled())
// Fetchers
list.AddRange(providers.Where(i => (i is IRemoteMetadataProvider)).Select(i => new MetadataPlugin
{
// Fetchers
list.AddRange(providers.Where(i => (i is IRemoteMetadataProvider)).Select(i => new MetadataPlugin
{
Name = i.Name,
Type = MetadataPluginType.MetadataFetcher
}));
}
Name = i.Name,
Type = MetadataPluginType.MetadataFetcher
}));

if (item.IsSaveLocalMetadataEnabled())
// Savers
list.AddRange(_savers.Where(i => IsSaverEnabledForItem(i, item, ItemUpdateType.MetadataEdit, true)).OrderBy(i => i.Name).Select(i => new MetadataPlugin
{
// Savers
list.AddRange(_savers.Where(i => IsSaverEnabledForItem(i, item, ItemUpdateType.MetadataEdit, true)).OrderBy(i => i.Name).Select(i => new MetadataPlugin
{
Name = i.Name,
Type = MetadataPluginType.MetadataSaver
}));
}
Name = i.Name,
Type = MetadataPluginType.MetadataSaver
}));
}

private void AddImagePlugins<T>(List<MetadataPlugin> list, T item, List<IImageProvider> imageProviders)
Expand Down
2 changes: 1 addition & 1 deletion MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ private void FetchEmbeddedInfo(Video video, Model.MediaInfo.MediaInfo data, Meta
}
if (!string.IsNullOrWhiteSpace(data.Name))
{
if (string.IsNullOrWhiteSpace(video.Name) || string.Equals(video.Name, Path.GetFileNameWithoutExtension(video.Path), StringComparison.OrdinalIgnoreCase))
if (string.IsNullOrWhiteSpace(video.Name) || (string.Equals(video.Name, Path.GetFileNameWithoutExtension(video.Path), StringComparison.OrdinalIgnoreCase) && !video.ProviderIds.Any()))
{
// Don't use the embedded name for extras because it will often be the same name as the movie
if (!video.ExtraType.HasValue && !video.IsOwnedItem)
Expand Down
3 changes: 3 additions & 0 deletions MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@
<Content Include="dashboard-ui\components\navdrawer\navdrawer.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\components\playerselection.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\components\remotecontrol.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
},
"devDependencies": {},
"ignore": [],
"version": "1.1.107",
"_release": "1.1.107",
"version": "1.1.108",
"_release": "1.1.108",
"_resolution": {
"type": "version",
"tag": "1.1.107",
"commit": "82a9be9ffc4359043cbbae83031491dc4d2182cc"
"tag": "1.1.108",
"commit": "ff2072d7422bd9e216a23e667c8fe08910c43265"
},
"_source": "https://github.com/MediaBrowser/Emby.ApiClient.Javascript.git",
"_target": "^1.1.51",
Expand Down
Loading

0 comments on commit 25e26d2

Please sign in to comment.