瀏覽代碼

update db CacheSize

Luke Pulverenti 8 年之前
父節點
當前提交
8e7b6f6bca

+ 1 - 7
Emby.Server.Implementations/Data/BaseSqliteRepository.cs

@@ -124,7 +124,7 @@ namespace Emby.Server.Implementations.Data
 
 
                 if (CacheSize.HasValue)
                 if (CacheSize.HasValue)
                 {
                 {
-                    queries.Add("PRAGMA cache_size=-" + CacheSize.Value.ToString(CultureInfo.InvariantCulture));
+                    queries.Add("PRAGMA cache_size=" + CacheSize.Value.ToString(CultureInfo.InvariantCulture));
                 }
                 }
 
 
                 if (EnableTempStoreMemory)
                 if (EnableTempStoreMemory)
@@ -132,12 +132,6 @@ namespace Emby.Server.Implementations.Data
                     queries.Add("PRAGMA temp_store = memory");
                     queries.Add("PRAGMA temp_store = memory");
                 }
                 }
 
 
-                //var cacheSize = CacheSize;
-                //if (cacheSize.HasValue)
-                //{
-
-                //}
-
                 ////foreach (var query in queries)
                 ////foreach (var query in queries)
                 ////{
                 ////{
                 ////    db.Execute(query);
                 ////    db.Execute(query);

+ 36 - 33
Emby.Server.Implementations/Data/SqliteItemRepository.cs

@@ -142,7 +142,7 @@ namespace Emby.Server.Implementations.Data
                    = "create table if not exists mediastreams (ItemId GUID, StreamIndex INT, StreamType TEXT, Codec TEXT, Language TEXT, ChannelLayout TEXT, Profile TEXT, AspectRatio TEXT, Path TEXT, IsInterlaced BIT, BitRate INT NULL, Channels INT NULL, SampleRate INT NULL, IsDefault BIT, IsForced BIT, IsExternal BIT, Height INT NULL, Width INT NULL, AverageFrameRate FLOAT NULL, RealFrameRate FLOAT NULL, Level FLOAT NULL, PixelFormat TEXT, BitDepth INT NULL, IsAnamorphic BIT NULL, RefFrames INT NULL, CodecTag TEXT NULL, Comment TEXT NULL, NalLengthSize TEXT NULL, IsAvc BIT NULL, Title TEXT NULL, TimeBase TEXT NULL, CodecTimeBase TEXT NULL, PRIMARY KEY (ItemId, StreamIndex))";
                    = "create table if not exists mediastreams (ItemId GUID, StreamIndex INT, StreamType TEXT, Codec TEXT, Language TEXT, ChannelLayout TEXT, Profile TEXT, AspectRatio TEXT, Path TEXT, IsInterlaced BIT, BitRate INT NULL, Channels INT NULL, SampleRate INT NULL, IsDefault BIT, IsForced BIT, IsExternal BIT, Height INT NULL, Width INT NULL, AverageFrameRate FLOAT NULL, RealFrameRate FLOAT NULL, Level FLOAT NULL, PixelFormat TEXT, BitDepth INT NULL, IsAnamorphic BIT NULL, RefFrames INT NULL, CodecTag TEXT NULL, Comment TEXT NULL, NalLengthSize TEXT NULL, IsAvc BIT NULL, Title TEXT NULL, TimeBase TEXT NULL, CodecTimeBase TEXT NULL, PRIMARY KEY (ItemId, StreamIndex))";
 
 
                 string[] queries = {
                 string[] queries = {
-                                "PRAGMA locking_mode=NORMAL",
+                                "PRAGMA locking_mode=EXCLUSIVE",
 
 
                                 "create table if not exists TypedBaseItems (guid GUID primary key NOT NULL, type TEXT NOT NULL, data BLOB NULL, ParentId GUID NULL, Path TEXT NULL)",
                                 "create table if not exists TypedBaseItems (guid GUID primary key NOT NULL, type TEXT NOT NULL, data BLOB NULL, ParentId GUID NULL, Path TEXT NULL)",
 
 
@@ -1258,22 +1258,6 @@ namespace Emby.Server.Implementations.Data
         {
         {
             if (_config.Configuration.SkipDeserializationForBasicTypes)
             if (_config.Configuration.SkipDeserializationForBasicTypes)
             {
             {
-                if (type == typeof(MusicGenre))
-                {
-                    return false;
-                }
-                if (type == typeof(GameGenre))
-                {
-                    return false;
-                }
-                if (type == typeof(Genre))
-                {
-                    return false;
-                }
-                if (type == typeof(Studio))
-                {
-                    return false;
-                }
                 if (type == typeof(Person))
                 if (type == typeof(Person))
                 {
                 {
                     return false;
                     return false;
@@ -1282,26 +1266,10 @@ namespace Emby.Server.Implementations.Data
                 {
                 {
                     return false;
                     return false;
                 }
                 }
-                if (type == typeof(ManualCollectionsFolder))
-                {
-                    return false;
-                }
-                if (type == typeof(CameraUploadsFolder))
-                {
-                    return false;
-                }
-                if (type == typeof(PlaylistsFolder))
-                {
-                    return false;
-                }
                 if (type == typeof(UserRootFolder))
                 if (type == typeof(UserRootFolder))
                 {
                 {
                     return false;
                     return false;
                 }
                 }
-                if (type == typeof(PhotoAlbum))
-                {
-                    return false;
-                }
                 if (type == typeof(Season))
                 if (type == typeof(Season))
                 {
                 {
                     return false;
                     return false;
@@ -1312,6 +1280,41 @@ namespace Emby.Server.Implementations.Data
                 }
                 }
             }
             }
 
 
+            if (type == typeof(MusicGenre))
+            {
+                return false;
+            }
+            if (type == typeof(GameGenre))
+            {
+                return false;
+            }
+            if (type == typeof(Genre))
+            {
+                return false;
+            }
+            if (type == typeof(Studio))
+            {
+                return false;
+            }
+
+            if (type == typeof(ManualCollectionsFolder))
+            {
+                return false;
+            }
+            if (type == typeof(CameraUploadsFolder))
+            {
+                return false;
+            }
+            if (type == typeof(PlaylistsFolder))
+            {
+                return false;
+            }
+
+            if (type == typeof(PhotoAlbum))
+            {
+                return false;
+            }
+
             if (type == typeof(Year))
             if (type == typeof(Year))
             {
             {
                 return false;
                 return false;