The Free Software Media System - Server Backend & API
update similar queries
Luke Pulverenti87c9f26e65ba
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.csindex 14b81022dd..42cbf19657 100644--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs@@ -2240,7 +2240,7 @@ namespace Emby.Server.Implementations.Dataif (query.SimilarTo != null && query.User != null){- return true;+ //return true;}var sortingFields = query.SortBy.ToList();@@ -2369,15 +2369,10 @@ namespace Emby.Server.Implementations.Databuilder.Append("+(Select Case When Abs(COALESCE(ProductionYear, 0) - @ItemProductionYear) < 10 Then 2 Else 0 End )");builder.Append("+(Select Case When Abs(COALESCE(ProductionYear, 0) - @ItemProductionYear) < 5 Then 2 Else 0 End )");- //// genres- builder.Append("+ ((Select count(CleanValue) from ItemValues where ItemId=Guid and Type=2 and CleanValue in (select CleanValue from itemvalues where ItemId=@SimilarItemId and type=2)) * 10)");-- //// tags- builder.Append("+ ((Select count(CleanValue) from ItemValues where ItemId=Guid and Type=4 and CleanValue in (select CleanValue from itemvalues where ItemId=@SimilarItemId and type=4)) * 10)");-- builder.Append("+ ((Select count(CleanValue) from ItemValues where ItemId=Guid and Type=5 and CleanValue in (select CleanValue from itemvalues where ItemId=@SimilarItemId and type=5)) * 10)");+ //// genres, tags+ builder.Append("+ ((Select count(CleanValue) from ItemValues where ItemId=Guid and Type in (2,3,4,5) and CleanValue in (select CleanValue from itemvalues where ItemId=@SimilarItemId and Type in (2,3,4,5))) * 10)");- builder.Append("+ ((Select count(CleanValue) from ItemValues where ItemId=Guid and Type=3 and CleanValue in (select CleanValue from itemvalues where ItemId=@SimilarItemId and type=3)) * 3)");+ //builder.Append("+ ((Select count(CleanValue) from ItemValues where ItemId=Guid and Type=3 and CleanValue in (select CleanValue from itemvalues where ItemId=@SimilarItemId and type=3)) * 3)");//builder.Append("+ ((Select count(Name) from People where ItemId=Guid and Name in (select Name from People where ItemId=@SimilarItemId)) * 3)");diff --git a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csprojindex eb5a5e26a3..e64a7d87c4 100644--- a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj+++ b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj@@ -307,9 +307,7 @@<None Include="LiveTv\TunerHosts\SatIp\ini\satellite\3594.ini" /><None Include="packages.config" /></ItemGroup>- <ItemGroup>- <Folder Include="Persistence\" />- </ItemGroup>+ <ItemGroup /><Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /><!-- To modify your build process, add your task inside one of the targets below and uncomment it.Other similar extension points exist, see Microsoft.Common.targets.diff --git a/MediaBrowser.Server.Startup.Common/Persistence/SqliteExtensions.cs b/MediaBrowser.Server.Startup.Common/Persistence/SqliteExtensions.csdeleted file mode 100644index 22aeb53dd7..0000000000--- a/MediaBrowser.Server.Startup.Common/Persistence/SqliteExtensions.cs+++ /dev/null@@ -1,57 +0,0 @@-using System;-using System.Data;-using System.Data.SQLite;-using System.Threading.Tasks;-using MediaBrowser.Model.Logging;--namespace Emby.Server.Core.Data-{- /// <summary>- /// Class SQLiteExtensions- /// </summary>- public static class SqliteExtensions- {- /// <summary>- /// Connects to db.- /// </summary>- public static async Task<IDbConnection> ConnectToDb(string dbPath,- bool isReadOnly,- bool enablePooling,- int? cacheSize,- ILogger logger)- {- if (string.IsNullOrEmpty(dbPath))- {- throw new ArgumentNullException("dbPath");- }-- SQLiteConnection.SetMemoryStatus(false);-- var connectionstr = new SQLiteConnectionStringBuilder- {- PageSize = 4096,- CacheSize = cacheSize ?? 2000,- SyncMode = SynchronizationModes.Normal,- DataSource = dbPath,- JournalMode = SQLiteJournalModeEnum.Wal,-- // This is causing crashing under linux- Pooling = enablePooling && Environment.OSVersion.Platform == PlatformID.Win32NT,- ReadOnly = isReadOnly- };-- var connectionString = connectionstr.ConnectionString;-- if (!enablePooling)- {- logger.Info("Sqlite {0} opening {1}", SQLiteConnection.SQLiteVersion, connectionString);- }-- var connection = new SQLiteConnection(connectionString);-- await connection.OpenAsync().ConfigureAwait(false);-- return connection;- }- }-}