Merge pull request #1751 from MediaBrowser/dev

Dev
pull/702/head
Luke 9 years ago
commit b2588b2667

@ -23,19 +23,6 @@ namespace MediaBrowser.Controller.Entities
PhysicalLocationsList = new List<string>();
}
/// <summary>
/// Gets a value indicating whether this instance is virtual folder.
/// </summary>
/// <value><c>true</c> if this instance is virtual folder; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
public override bool IsVirtualFolder
{
get
{
return true;
}
}
[IgnoreDataMember]
protected override bool SupportsShortcutChildren
{

@ -126,19 +126,6 @@ namespace MediaBrowser.Controller.Entities
/// <value><c>true</c> if this instance is root; otherwise, <c>false</c>.</value>
public bool IsRoot { get; set; }
/// <summary>
/// Gets a value indicating whether this instance is virtual folder.
/// </summary>
/// <value><c>true</c> if this instance is virtual folder; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
public virtual bool IsVirtualFolder
{
get
{
return false;
}
}
public virtual List<LinkedChild> LinkedChildren { get; set; }
[IgnoreDataMember]

@ -20,12 +20,15 @@ namespace MediaBrowser.Model.LiveTv
public int PrePaddingSeconds { get; set; }
public int PostPaddingSeconds { get; set; }
public string[] MediaLocationsCreated { get; set; }
public LiveTvOptions()
{
EnableMovieProviders = true;
EnableRecordingSubfolders = true;
TunerHosts = new List<TunerHostInfo>();
ListingProviders = new List<ListingsProviderInfo>();
MediaLocationsCreated = new string[] { };
}
}

@ -69,7 +69,7 @@ namespace MediaBrowser.Providers.TV
if (!hasSeason)
{
await AddSeason(series, seasonNumber, cancellationToken).ConfigureAwait(false);
await AddSeason(series, seasonNumber, false, cancellationToken).ConfigureAwait(false);
hasChanges = true;
}
@ -83,7 +83,7 @@ namespace MediaBrowser.Providers.TV
if (!hasSeason)
{
await AddSeason(series, null, cancellationToken).ConfigureAwait(false);
await AddSeason(series, null, false, cancellationToken).ConfigureAwait(false);
hasChanges = true;
}
@ -95,12 +95,9 @@ namespace MediaBrowser.Providers.TV
/// <summary>
/// Adds the season.
/// </summary>
/// <param name="series">The series.</param>
/// <param name="seasonNumber">The season number.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{Season}.</returns>
public async Task<Season> AddSeason(Series series,
int? seasonNumber,
bool isMissingSeason,
CancellationToken cancellationToken)
{
var seasonName = seasonNumber == 0 ?
@ -113,7 +110,8 @@ namespace MediaBrowser.Providers.TV
{
Name = seasonName,
IndexNumber = seasonNumber,
Id = _libraryManager.GetNewItemId((series.Id + (seasonNumber ?? -1).ToString(_usCulture) + seasonName), typeof(Season))
Id = _libraryManager.GetNewItemId((series.Id + (seasonNumber ?? -1).ToString(_usCulture) + seasonName), typeof(Season)),
IsMissingSeason = isMissingSeason
};
season.SetParent(series);

@ -418,7 +418,7 @@ namespace MediaBrowser.Providers.TV
if (season == null)
{
var provider = new DummySeasonProvider(_config, _logger, _localization, _libraryManager, _fileSystem);
season = await provider.AddSeason(series, seasonNumber, cancellationToken).ConfigureAwait(false);
season = await provider.AddSeason(series, seasonNumber, true, cancellationToken).ConfigureAwait(false);
}
var name = string.Format("Episode {0}", episodeNumber.ToString(_usCulture));

@ -69,7 +69,7 @@ namespace MediaBrowser.Providers.TV
private ItemUpdateType SaveIsMissing(Season item, List<Episode> episodes)
{
var isMissing = item.LocationType == LocationType.Virtual && episodes.All(i => i.IsMissingEpisode);
var isMissing = item.LocationType == LocationType.Virtual && (episodes.Count == 0 || episodes.All(i => i.IsMissingEpisode));
if (item.IsMissingSeason != isMissing)
{

@ -115,17 +115,13 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
{
var recordingFolders = GetRecordingFolders();
var defaultRecordingPath = DefaultRecordingPath;
if (!recordingFolders.Any(i => i.Locations.Contains(defaultRecordingPath, StringComparer.OrdinalIgnoreCase)))
{
RemovePathFromLibrary(defaultRecordingPath);
}
var virtualFolders = _libraryManager.GetVirtualFolders()
.ToList();
var allExistingPaths = virtualFolders.SelectMany(i => i.Locations).ToList();
var pathsAdded = new List<string>();
foreach (var recordingFolder in recordingFolders)
{
var pathsToCreate = recordingFolder.Locations
@ -145,11 +141,33 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
{
_logger.ErrorException("Error creating virtual folder", ex);
}
pathsAdded.AddRange(pathsToCreate);
}
var config = GetConfiguration();
var pathsToRemove = config.MediaLocationsCreated
.Except(recordingFolders.SelectMany(i => i.Locations))
.ToList();
if (pathsAdded.Count > 0 || pathsToRemove.Count > 0)
{
pathsAdded.InsertRange(0, config.MediaLocationsCreated);
config.MediaLocationsCreated = pathsAdded.Except(pathsToRemove).Distinct(StringComparer.OrdinalIgnoreCase).ToArray();
_config.SaveConfiguration("livetv", config);
}
foreach (var path in pathsToRemove)
{
RemovePathFromLibrary(path);
}
}
private void RemovePathFromLibrary(string path)
{
_logger.Debug("Removing path from library: {0}", path);
var requiresRefresh = false;
var virtualFolders = _libraryManager.GetVirtualFolders()
.ToList();

@ -1420,8 +1420,9 @@ namespace MediaBrowser.Server.Implementations.LiveTv
MediaTypes = new[] { MediaType.Video },
Recursive = true,
AncestorIds = folders.Select(i => i.Id.ToString("N")).ToArray(),
IsFolder = false,
ExcludeLocationTypes = new[] { LocationType.Virtual },
Limit = Math.Min(10, query.Limit ?? int.MaxValue),
Limit = Math.Min(200, query.Limit ?? int.MaxValue),
SortBy = new[] { ItemSortBy.DateCreated },
SortOrder = SortOrder.Descending
});

@ -107,9 +107,6 @@
<Content Include="dashboard-ui\components\chromecasthelpers.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\bower_components\fastclick\lib\fastclick.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\components\favoriteitems.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@ -1686,6 +1683,9 @@
<None Include="dashboard-ui\strings\id.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="dashboard-ui\strings\sk.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="dashboard-ui\strings\zh-HK.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common.Internal</id>
<version>3.0.647</version>
<version>3.0.648</version>
<title>MediaBrowser.Common.Internal</title>
<authors>Luke</authors>
<owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains common components shared by Emby Theater and Emby Server. Not intended for plugin developer consumption.</description>
<copyright>Copyright © Emby 2013</copyright>
<dependencies>
<dependency id="MediaBrowser.Common" version="3.0.647" />
<dependency id="MediaBrowser.Common" version="3.0.648" />
<dependency id="NLog" version="4.3.4" />
<dependency id="SimpleInjector" version="3.1.4" />
</dependencies>

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common</id>
<version>3.0.647</version>
<version>3.0.648</version>
<title>MediaBrowser.Common</title>
<authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners>

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Model.Signed</id>
<version>3.0.647</version>
<title>MediaBrowser.Model - Signed Edition</title>
<authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners>
<projectUrl>https://github.com/MediaBrowser/MediaBrowser</projectUrl>
<iconUrl>http://www.mb3admin.com/images/mb3icons1-1.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Contains common model objects and interfaces used by all Emby solutions.</description>
<copyright>Copyright © Emby 2013</copyright>
<dependencies>
</dependencies>
</metadata>
<files>
<file src="dllssigned\net45\MediaBrowser.Model.dll" target="lib\net45\MediaBrowser.Model.dll" />
</files>
</package>

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>MediaBrowser.Server.Core</id>
<version>3.0.647</version>
<version>3.0.648</version>
<title>Media Browser.Server.Core</title>
<authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Emby Server.</description>
<copyright>Copyright © Emby 2013</copyright>
<dependencies>
<dependency id="MediaBrowser.Common" version="3.0.647" />
<dependency id="MediaBrowser.Common" version="3.0.648" />
<dependency id="Interfaces.IO" version="1.0.0.5" />
</dependencies>
</metadata>

Loading…
Cancel
Save