aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs2
-rw-r--r--MediaBrowser.Server.Implementations/Persistence/SqliteExtensions.cs102
-rw-r--r--MediaBrowser.Server.Startup.Common/Migrations/FolderViewSettingMigration.cs5
3 files changed, 5 insertions, 104 deletions
diff --git a/MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs b/MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs
index d76c89dfb..6e57b4022 100644
--- a/MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs
+++ b/MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs
@@ -25,7 +25,7 @@ namespace MediaBrowser.Providers.Music
private readonly IApplicationHost _appHost;
private readonly ILogger _logger;
- public static string MusicBrainzBaseUrl = "http://musicbrainz.fercasas.com:5000";
+ public static string MusicBrainzBaseUrl = "https://www.musicbrainz.org";
public MusicBrainzAlbumProvider(IHttpClient httpClient, IApplicationHost appHost, ILogger logger)
{
diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteExtensions.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteExtensions.cs
index 519731a5c..dd2f15cfd 100644
--- a/MediaBrowser.Server.Implementations/Persistence/SqliteExtensions.cs
+++ b/MediaBrowser.Server.Implementations/Persistence/SqliteExtensions.cs
@@ -48,13 +48,6 @@ namespace MediaBrowser.Server.Implementations.Persistence
return connection;
}
- public static void BindGetSimilarityScore(IDbConnection connection, ILogger logger)
- {
- var sqlConnection = (SQLiteConnection)connection;
- SimiliarToFunction.Logger = logger;
- sqlConnection.BindFunction(new SimiliarToFunction());
- }
-
public static void BindFunction(this SQLiteConnection connection, SQLiteFunction function)
{
var attributes = function.GetType().GetCustomAttributes(typeof(SQLiteFunctionAttribute), true).Cast<SQLiteFunctionAttribute>().ToArray();
@@ -65,99 +58,4 @@ namespace MediaBrowser.Server.Implementations.Persistence
connection.BindFunction(attributes[0], function);
}
}
-
- [SQLiteFunction(Name = "GetSimilarityScore", Arguments = 6, FuncType = FunctionType.Scalar)]
- public class SimiliarToFunction : SQLiteFunction
- {
- internal static ILogger Logger;
-
- private readonly Dictionary<string, int> _personTypeScores = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase)
- {
- { PersonType.Actor, 3},
- { PersonType.Director, 5},
- { PersonType.Composer, 2},
- { PersonType.GuestStar, 3},
- { PersonType.Writer, 2},
- { PersonType.Conductor, 2},
- { PersonType.Producer, 2},
- { PersonType.Lyricist, 2}
- };
-
- public override object Invoke(object[] args)
- {
- var score = 0;
-
- // Official rating equals
- if ((long)args[0] == 1)
- {
- score += 10;
- }
-
- // Year difference
- long? yearDifference = args[1] == null ? (long?)null : (long)args[1];
- if (yearDifference.HasValue)
- {
- var diff = Math.Abs(yearDifference.Value);
-
- // Add if they came out within the same decade
- if (diff < 10)
- {
- score += 2;
- }
-
- // And more if within five years
- if (diff < 5)
- {
- score += 2;
- }
- }
-
- // genres
- score += Convert.ToInt32((long)args[2]) * 10;
-
- // tags
- score += Convert.ToInt32((long)args[3]) * 10;
-
- // # of common keywords
- score += Convert.ToInt32((long)args[4]) *10;
-
- // # of common studios
- score += Convert.ToInt32((long)args[5]) * 3;
-
- // studios
- //score += GetListScore(args, 7, 8, 3);
-
- //var rowPeopleNamesText = (args[12] as string) ?? string.Empty;
- //var rowPeopleNames = rowPeopleNamesText.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
-
- //foreach (var name in rowPeopleNames)
- //{
- // // TODO: Send along person types
- // score += 3;
- //}
-
- //Logger.Debug("Returning score {0}", score);
- return score;
- }
-
- private int GetListScore(object[] args, int index1, int index2, int value = 10)
- {
- var score = 0;
-
- var inputGenres = args[index1] as string;
- var rowGenres = args[index2] as string;
- var inputGenreList = string.IsNullOrWhiteSpace(inputGenres) ? new string[] { } : inputGenres.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
- var rowGenresList = string.IsNullOrWhiteSpace(rowGenres) ? new string[] { } : rowGenres.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
-
- foreach (var genre in inputGenreList)
- {
- if (rowGenresList.Contains(genre, StringComparer.OrdinalIgnoreCase))
- {
- score += value;
- }
- }
-
- return score;
- }
- }
}
diff --git a/MediaBrowser.Server.Startup.Common/Migrations/FolderViewSettingMigration.cs b/MediaBrowser.Server.Startup.Common/Migrations/FolderViewSettingMigration.cs
index 4049d1754..12054864b 100644
--- a/MediaBrowser.Server.Startup.Common/Migrations/FolderViewSettingMigration.cs
+++ b/MediaBrowser.Server.Startup.Common/Migrations/FolderViewSettingMigration.cs
@@ -24,7 +24,10 @@ namespace MediaBrowser.Server.Startup.Common.Migrations
{
if (_config.Configuration.IsStartupWizardCompleted)
{
- _config.Configuration.EnableFolderView = _userManager.Users.Any(i => i.Configuration.DisplayFoldersView);
+ if (_userManager.Users.Any(i => i.Configuration.DisplayFoldersView))
+ {
+ _config.Configuration.EnableFolderView = true;
+ }
}
migrationKeyList.Add(migrationKey);