diff --git a/MediaBrowser.Api/StartupWizardService.cs b/MediaBrowser.Api/StartupWizardService.cs
index 87562b126..1bebd42eb 100644
--- a/MediaBrowser.Api/StartupWizardService.cs
+++ b/MediaBrowser.Api/StartupWizardService.cs
@@ -117,7 +117,7 @@ namespace MediaBrowser.Api
config.EnableStandaloneMusicKeys = true;
config.EnableCaseSensitiveItemIds = true;
//config.EnableFolderView = true;
- config.SchemaVersion = 107;
+ config.SchemaVersion = 108;
}
public void Post(UpdateStartupConfiguration request)
diff --git a/MediaBrowser.Common.Implementations/Updates/GithubUpdater.cs b/MediaBrowser.Common.Implementations/Updates/GithubUpdater.cs
index 2ffaedc4b..d1ec30210 100644
--- a/MediaBrowser.Common.Implementations/Updates/GithubUpdater.cs
+++ b/MediaBrowser.Common.Implementations/Updates/GithubUpdater.cs
@@ -54,7 +54,9 @@ namespace MediaBrowser.Common.Implementations.Updates
{
if (updateLevel == PackageVersionClass.Release)
{
- obj = obj.Where(i => !i.prerelease).ToArray();
+ // Technically all we need to do is check that it's not pre-release
+ // But let's addititional checks for -beta and -dev to handle builds that might be temporarily tagged incorrectly.
+ obj = obj.Where(i => !i.prerelease && !i.name.EndsWith("-beta", StringComparison.OrdinalIgnoreCase) && !i.name.EndsWith("-dev", StringComparison.OrdinalIgnoreCase)).ToArray();
}
else if (updateLevel == PackageVersionClass.Beta)
{
@@ -70,7 +72,7 @@ namespace MediaBrowser.Common.Implementations.Updates
.Where(i => i != null)
.OrderByDescending(i => Version.Parse(i.AvailableVersion))
.FirstOrDefault();
-
+
return availableUpdate ?? new CheckForUpdateResult
{
IsUpdateAvailable = false
diff --git a/MediaBrowser.Controller/Entities/Book.cs b/MediaBrowser.Controller/Entities/Book.cs
index 9d35c86d2..2ca56bc70 100644
--- a/MediaBrowser.Controller/Entities/Book.cs
+++ b/MediaBrowser.Controller/Entities/Book.cs
@@ -22,7 +22,13 @@ namespace MediaBrowser.Controller.Entities
public string SeriesName { get; set; }
[IgnoreDataMember]
public Guid? SeriesId { get; set; }
+ [IgnoreDataMember]
+ public string SeriesSortName { get; set; }
+ public string FindSeriesSortName()
+ {
+ return SeriesSortName;
+ }
public string FindSeriesName()
{
return SeriesName;
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs
index 210c11564..89b9479e7 100644
--- a/MediaBrowser.Controller/Entities/Folder.cs
+++ b/MediaBrowser.Controller/Entities/Folder.cs
@@ -760,11 +760,6 @@ namespace MediaBrowser.Controller.Entities
Logger.Debug("Query requires post-filtering due to ItemSortBy.Revenue");
return true;
}
- if (query.SortBy.Contains(ItemSortBy.SeriesSortName, StringComparer.OrdinalIgnoreCase))
- {
- Logger.Debug("Query requires post-filtering due to ItemSortBy.SeriesSortName");
- return true;
- }
if (query.SortBy.Contains(ItemSortBy.VideoBitRate, StringComparer.OrdinalIgnoreCase))
{
Logger.Debug("Query requires post-filtering due to ItemSortBy.VideoBitRate");
@@ -859,24 +854,6 @@ namespace MediaBrowser.Controller.Entities
return true;
}
- if (query.IsMissing.HasValue)
- {
- Logger.Debug("Query requires post-filtering due to IsMissing");
- return true;
- }
-
- if (query.IsUnaired.HasValue)
- {
- Logger.Debug("Query requires post-filtering due to IsUnaired");
- return true;
- }
-
- if (query.IsVirtualUnaired.HasValue)
- {
- Logger.Debug("Query requires post-filtering due to IsVirtualUnaired");
- return true;
- }
-
if (UserViewBuilder.CollapseBoxSetItems(query, this, query.User, ConfigurationManager))
{
Logger.Debug("Query requires post-filtering due to CollapseBoxSetItems");
diff --git a/MediaBrowser.Controller/Entities/IHasSeries.cs b/MediaBrowser.Controller/Entities/IHasSeries.cs
index d4dbb8ef6..531f58788 100644
--- a/MediaBrowser.Controller/Entities/IHasSeries.cs
+++ b/MediaBrowser.Controller/Entities/IHasSeries.cs
@@ -11,6 +11,8 @@ namespace MediaBrowser.Controller.Entities
/// The name of the series.
string SeriesName { get; set; }
string FindSeriesName();
+ string SeriesSortName { get; set; }
+ string FindSeriesSortName();
Guid? SeriesId { get; set; }
Guid? FindSeriesId();
}
diff --git a/MediaBrowser.Controller/Entities/TV/Episode.cs b/MediaBrowser.Controller/Entities/TV/Episode.cs
index 78c35ad48..726390f65 100644
--- a/MediaBrowser.Controller/Entities/TV/Episode.cs
+++ b/MediaBrowser.Controller/Entities/TV/Episode.cs
@@ -53,7 +53,16 @@ namespace MediaBrowser.Controller.Entities.TV
/// This is the ending episode number for double episodes.
///
/// The index number.
- public int? IndexNumberEnd { get; set; }
+ public int? IndexNumberEnd { get; set; }
+
+ [IgnoreDataMember]
+ public string SeriesSortName { get; set; }
+
+ public string FindSeriesSortName()
+ {
+ var series = Series;
+ return series == null ? SeriesSortName : series.SortName;
+ }
[IgnoreDataMember]
protected override bool SupportsOwnedItems
diff --git a/MediaBrowser.Controller/Entities/TV/Season.cs b/MediaBrowser.Controller/Entities/TV/Season.cs
index 865cadeb9..ee01c60b1 100644
--- a/MediaBrowser.Controller/Entities/TV/Season.cs
+++ b/MediaBrowser.Controller/Entities/TV/Season.cs
@@ -51,6 +51,15 @@ namespace MediaBrowser.Controller.Entities.TV
}
}
+ [IgnoreDataMember]
+ public string SeriesSortName { get; set; }
+
+ public string FindSeriesSortName()
+ {
+ var series = Series;
+ return series == null ? SeriesSortName : series.SortName;
+ }
+
// Genre, Rating and Stuido will all be the same
protected override IEnumerable GetIndexByOptions()
{
diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.cs
index 09ddbc6b6..ad35b3d36 100644
--- a/MediaBrowser.Controller/Entities/TV/Series.cs
+++ b/MediaBrowser.Controller/Entities/TV/Series.cs
@@ -449,13 +449,8 @@ namespace MediaBrowser.Controller.Entities.TV
return true;
}
- if (!episode.ParentIndexNumber.HasValue)
- {
- var season = episode.Season;
- return season != null && string.Equals(GetUniqueSeriesKey(season), seasonPresentationKey, StringComparison.OrdinalIgnoreCase);
- }
-
- return false;
+ var season = episode.Season;
+ return season != null && string.Equals(GetUniqueSeriesKey(season), seasonPresentationKey, StringComparison.OrdinalIgnoreCase);
});
}
diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
index a6c5d5429..82be653e1 100644
--- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
+++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
@@ -1932,7 +1932,7 @@ namespace MediaBrowser.Server.Implementations.Library
private string GetContentTypeOverride(string path, bool inherit)
{
- var nameValuePair = ConfigurationManager.Configuration.ContentTypes.FirstOrDefault(i => string.Equals(i.Name, path, StringComparison.OrdinalIgnoreCase) || (inherit && _fileSystem.ContainsSubPath(i.Name, path)));
+ var nameValuePair = ConfigurationManager.Configuration.ContentTypes.FirstOrDefault(i => string.Equals(i.Name, path, StringComparison.OrdinalIgnoreCase) || (inherit && !string.IsNullOrWhiteSpace(i.Name) && _fileSystem.ContainsSubPath(i.Name, path)));
if (nameValuePair != null)
{
return nameValuePair.Value;
@@ -2813,6 +2813,11 @@ namespace MediaBrowser.Server.Implementations.Library
private void RemoveContentTypeOverrides(string path)
{
+ if (string.IsNullOrWhiteSpace(path))
+ {
+ throw new ArgumentNullException("path");
+ }
+
var removeList = new List();
foreach (var contentType in ConfigurationManager.Configuration.ContentTypes)
diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
index a3217e3ed..5e09c1d0b 100644
--- a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
+++ b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
@@ -95,7 +95,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
private IDbCommand _updateInheritedRatingCommand;
private IDbCommand _updateInheritedTagsCommand;
- public const int LatestSchemaVersion = 107;
+ public const int LatestSchemaVersion = 108;
///
/// Initializes a new instance of the class.
@@ -272,6 +272,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
_connection.AddColumn(Logger, "TypedBaseItems", "SeasonName", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "SeasonId", "GUID");
_connection.AddColumn(Logger, "TypedBaseItems", "SeriesId", "GUID");
+ _connection.AddColumn(Logger, "TypedBaseItems", "SeriesSortName", "Text");
_connection.AddColumn(Logger, "UserDataKeys", "Priority", "INT");
_connection.AddColumn(Logger, "ItemValues", "CleanValue", "Text");
@@ -412,7 +413,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
"SeriesName",
"SeasonName",
"SeasonId",
- "SeriesId"
+ "SeriesId",
+ "SeriesSortName"
};
private readonly string[] _mediaStreamSaveColumns =
@@ -535,7 +537,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
"UserDataKey",
"SeasonName",
"SeasonId",
- "SeriesId"
+ "SeriesId",
+ "SeriesSortName"
};
_saveItemCommand = _connection.CreateCommand();
_saveItemCommand.CommandText = "replace into TypedBaseItems (" + string.Join(",", saveColumns.ToArray()) + ") values (";
@@ -982,10 +985,12 @@ namespace MediaBrowser.Server.Implementations.Persistence
if (hasSeries != null)
{
_saveItemCommand.GetParameter(index++).Value = hasSeries.FindSeriesId();
+ _saveItemCommand.GetParameter(index++).Value = hasSeries.FindSeriesSortName();
}
else
{
_saveItemCommand.GetParameter(index++).Value = null;
+ _saveItemCommand.GetParameter(index++).Value = null;
}
_saveItemCommand.Transaction = transaction;
@@ -1440,6 +1445,14 @@ namespace MediaBrowser.Server.Implementations.Persistence
}
}
+ if (hasSeries != null)
+ {
+ if (!reader.IsDBNull(63))
+ {
+ hasSeries.SeriesSortName = reader.GetString(63);
+ }
+ }
+
return item;
}
@@ -3056,6 +3069,39 @@ namespace MediaBrowser.Server.Implementations.Persistence
whereClauses.Add("LocationType<>'Virtual'");
}
}
+ if (query.IsUnaired.HasValue)
+ {
+ if (query.IsUnaired.Value)
+ {
+ whereClauses.Add("PremiereDate >= DATETIME('now')");
+ }
+ else
+ {
+ whereClauses.Add("PremiereDate < DATETIME('now')");
+ }
+ }
+ if (query.IsMissing.HasValue && _config.Configuration.SchemaVersion >= 90)
+ {
+ if (query.IsMissing.Value)
+ {
+ whereClauses.Add("(IsVirtualItem=1 AND PremiereDate < DATETIME('now'))");
+ }
+ else
+ {
+ whereClauses.Add("(IsVirtualItem=0 OR PremiereDate >= DATETIME('now'))");
+ }
+ }
+ if (query.IsVirtualUnaired.HasValue && _config.Configuration.SchemaVersion >= 90)
+ {
+ if (query.IsVirtualUnaired.Value)
+ {
+ whereClauses.Add("(IsVirtualItem=1 AND PremiereDate >= DATETIME('now'))");
+ }
+ else
+ {
+ whereClauses.Add("(IsVirtualItem=0 OR PremiereDate < DATETIME('now'))");
+ }
+ }
if (query.MediaTypes.Length == 1)
{
whereClauses.Add("MediaType=@MediaTypes");
diff --git a/MediaBrowser.Server.Implementations/Sorting/SeriesSortNameComparer.cs b/MediaBrowser.Server.Implementations/Sorting/SeriesSortNameComparer.cs
index 4efc3218b..6bc1264a4 100644
--- a/MediaBrowser.Server.Implementations/Sorting/SeriesSortNameComparer.cs
+++ b/MediaBrowser.Server.Implementations/Sorting/SeriesSortNameComparer.cs
@@ -1,5 +1,4 @@
using MediaBrowser.Controller.Entities;
-using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Sorting;
using MediaBrowser.Model.Querying;
using System;
@@ -21,28 +20,9 @@ namespace MediaBrowser.Server.Implementations.Sorting
private string GetValue(BaseItem item)
{
- Series series = null;
+ var hasSeries = item as IHasSeries;
- var season = item as Season;
-
- if (season != null)
- {
- series = season.Series;
- }
-
- var episode = item as Episode;
-
- if (episode != null)
- {
- series = episode.Series;
- }
-
- if (series == null)
- {
- series = item as Series;
- }
-
- return series != null ? series.SortName : null;
+ return hasSeries != null ? hasSeries.SeriesSortName : null;
}
///
diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs
index 1a227126e..d42382442 100644
--- a/MediaBrowser.WebDashboard/Api/DashboardService.cs
+++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs
@@ -349,8 +349,8 @@ namespace MediaBrowser.WebDashboard.Api
}
_fileSystem.DeleteDirectory(Path.Combine(bowerPath, "jquery", "src"), true);
- _fileSystem.DeleteDirectory(Path.Combine(bowerPath, "fingerprintjs2", "flash"), true);
- _fileSystem.DeleteDirectory(Path.Combine(bowerPath, "fingerprintjs2", "specs"), true);
+ //_fileSystem.DeleteDirectory(Path.Combine(bowerPath, "fingerprintjs2", "flash"), true);
+ //_fileSystem.DeleteDirectory(Path.Combine(bowerPath, "fingerprintjs2", "specs"), true);
DeleteCryptoFiles(Path.Combine(bowerPath, "cryptojslib", "components"));
@@ -358,12 +358,7 @@ namespace MediaBrowser.WebDashboard.Api
DeleteFoldersByName(Path.Combine(bowerPath, "jstree"), "src");
DeleteFoldersByName(Path.Combine(bowerPath, "Sortable"), "meteor");
DeleteFoldersByName(Path.Combine(bowerPath, "Sortable"), "st");
- DeleteFoldersByName(Path.Combine(bowerPath, "Swiper"), "src");
-
- _fileSystem.DeleteDirectory(Path.Combine(bowerPath, "marked"), true);
- _fileSystem.DeleteDirectory(Path.Combine(bowerPath, "marked-element"), true);
- _fileSystem.DeleteDirectory(Path.Combine(bowerPath, "prism"), true);
- _fileSystem.DeleteDirectory(Path.Combine(bowerPath, "prism-element"), true);
+ //DeleteFoldersByName(Path.Combine(bowerPath, "Swiper"), "src");
if (string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase))
{