diff --git a/src/ImageProcessor.Web/Caching/CachedImage.cs b/src/ImageProcessor.Web/Caching/CachedImage.cs index 1f19d8fdf..d51fb549e 100644 --- a/src/ImageProcessor.Web/Caching/CachedImage.cs +++ b/src/ImageProcessor.Web/Caching/CachedImage.cs @@ -14,34 +14,43 @@ namespace ImageProcessor.Web.Caching /// /// Describes a cached image /// - internal sealed class CachedImage + internal sealed class CachedImage { /// /// Initializes a new instance of the class. /// /// - /// The value of the cached item. + /// The value of the cached image. + /// + /// + /// The maximum age in days cached image. /// /// - /// The last write time of the cached item. + /// The last write time of the cached image. /// /// /// The expires time. /// - public CachedImage(string path, DateTime lastWriteTimeUtc, DateTime expiresTimeUtc) + public CachedImage(string path, int maxAge, DateTime lastWriteTimeUtc, DateTime expiresTimeUtc) { this.Path = path; + this.MaxAge = maxAge; this.LastWriteTimeUtc = lastWriteTimeUtc; this.ExpiresUtc = expiresTimeUtc; } /// - /// Gets or sets the value of the cached image + /// Gets or sets the value of the cached image. /// public string Path { get; set; } /// - /// Gets or sets the last write time of the cached image + /// The maximum age of the cached image in days. + /// + public int MaxAge { get; set; } + + /// + /// Gets or sets the last write time of the cached image. /// public DateTime LastWriteTimeUtc { get; set; } diff --git a/src/ImageProcessor.Web/Caching/DiskCache.cs b/src/ImageProcessor.Web/Caching/DiskCache.cs index 5c781ad6c..ed4df4adc 100644 --- a/src/ImageProcessor.Web/Caching/DiskCache.cs +++ b/src/ImageProcessor.Web/Caching/DiskCache.cs @@ -105,7 +105,7 @@ namespace ImageProcessor.Web.Caching { string key = Path.GetFileNameWithoutExtension(cachedPath); DateTime expires = DateTime.UtcNow.AddDays(MaxFileCachedDuration).ToUniversalTime(); - CachedImage cachedImage = new CachedImage(cachedPath, lastWriteTimeUtc, expires); + CachedImage cachedImage = new CachedImage(cachedPath, MaxFileCachedDuration, lastWriteTimeUtc, expires); PersistantDictionary.Instance.Add(key, cachedImage); } @@ -149,8 +149,10 @@ namespace ImageProcessor.Web.Caching if (PersistantDictionary.Instance.TryGetValue(key, out cachedImage)) { // Check to see if the last write time is different of whether the - // chached image is set to expire. - if (imageFileInfo.LastWriteTimeUtc != cachedImage.LastWriteTimeUtc || cachedImage.ExpiresUtc < DateTime.UtcNow.AddDays(-MaxFileCachedDuration)) + // cached image is set to expire or if the max age is different. + if (imageFileInfo.LastWriteTimeUtc != cachedImage.LastWriteTimeUtc + || cachedImage.ExpiresUtc < DateTime.UtcNow.AddDays(-MaxFileCachedDuration) + || cachedImage.MaxAge != MaxFileCachedDuration) { if (PersistantDictionary.Instance.TryRemove(key, out cachedImage)) { diff --git a/src/ImageProcessor.Web/Caching/SQLContext.cs b/src/ImageProcessor.Web/Caching/SQLContext.cs index 56aceed87..773073da9 100644 --- a/src/ImageProcessor.Web/Caching/SQLContext.cs +++ b/src/ImageProcessor.Web/Caching/SQLContext.cs @@ -69,6 +69,7 @@ namespace ImageProcessor.Web.Caching command.CommandText = @"CREATE TABLE names (Key TEXT, Path TEXT, + MaxAge INTEGER, LastWriteTimeUtc TEXT, ExpiresUtc TEXT, PRIMARY KEY (Key), @@ -107,12 +108,13 @@ namespace ImageProcessor.Web.Caching { using (SQLiteCommand command = new SQLiteCommand(connection)) { - command.CommandText = "INSERT INTO names VALUES(?, ?, ?, ?)"; + command.CommandText = "INSERT INTO names VALUES(?, ?, ?, ?, ?)"; SQLiteParameter[] parameters = new[] { new SQLiteParameter("Key", key), new SQLiteParameter("Path", image.Path), + new SQLiteParameter("MaxAge", image.MaxAge), new SQLiteParameter("LastWriteTimeUtc", image.LastWriteTimeUtc), new SQLiteParameter("ExpiresUtc", image.ExpiresUtc) }; @@ -198,6 +200,7 @@ namespace ImageProcessor.Web.Caching string key = reader["Key"].ToString(); CachedImage image = new CachedImage( reader["Path"].ToString(), + int.Parse(reader["MaxAge"].ToString()), DateTime.Parse(reader["LastWriteTimeUtc"].ToString()).ToUniversalTime(), DateTime.Parse(reader["ExpiresUtc"].ToString()).ToUniversalTime()); diff --git a/src/ImageProcessor.Web/ImageProcessor.Web.csproj b/src/ImageProcessor.Web/ImageProcessor.Web.csproj index 405a17081..cc9849b33 100644 --- a/src/ImageProcessor.Web/ImageProcessor.Web.csproj +++ b/src/ImageProcessor.Web/ImageProcessor.Web.csproj @@ -69,13 +69,13 @@ - + False - ..\packages\System.Data.SQLite.x86.1.0.84.0\lib\net40\System.Data.SQLite.dll + ..\packages\System.Data.SQLite.1.0.84.0\lib\net40\System.Data.SQLite.dll False - ..\packages\System.Data.SQLite.x86.1.0.84.0\lib\net40\System.Data.SQLite.Linq.dll + ..\packages\System.Data.SQLite.1.0.84.0\lib\net40\System.Data.SQLite.Linq.dll @@ -106,6 +106,14 @@ ImageProcessor + + + Always + + + Always + + diff --git a/src/ImageProcessor.Web/packages.config b/src/ImageProcessor.Web/packages.config index 48ffaba2b..515bf32f7 100644 --- a/src/ImageProcessor.Web/packages.config +++ b/src/ImageProcessor.Web/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/ImageProcessor.Web/x64/SQLite.Interop.dll.REMOVED.git-id b/src/ImageProcessor.Web/x64/SQLite.Interop.dll.REMOVED.git-id new file mode 100644 index 000000000..5453e41eb --- /dev/null +++ b/src/ImageProcessor.Web/x64/SQLite.Interop.dll.REMOVED.git-id @@ -0,0 +1 @@ +cb352e8236b42cc560ee62583a5b8e0d14d87851 \ No newline at end of file diff --git a/src/ImageProcessor.Web/x86/SQLite.Interop.dll.REMOVED.git-id b/src/ImageProcessor.Web/x86/SQLite.Interop.dll.REMOVED.git-id new file mode 100644 index 000000000..0af219bb6 --- /dev/null +++ b/src/ImageProcessor.Web/x86/SQLite.Interop.dll.REMOVED.git-id @@ -0,0 +1 @@ +1838fba8df03d11c4b76a63b922448593bc908ce \ No newline at end of file diff --git a/src/Test/Test/Web.config b/src/Test/Test/Web.config index 7dfdc98c1..29546e611 100644 --- a/src/Test/Test/Web.config +++ b/src/Test/Test/Web.config @@ -64,7 +64,7 @@ - + diff --git a/src/packages/System.Data.SQLite.1.0.84.0/System.Data.SQLite.1.0.84.0.nupkg.REMOVED.git-id b/src/packages/System.Data.SQLite.1.0.84.0/System.Data.SQLite.1.0.84.0.nupkg.REMOVED.git-id new file mode 100644 index 000000000..99b113ec2 --- /dev/null +++ b/src/packages/System.Data.SQLite.1.0.84.0/System.Data.SQLite.1.0.84.0.nupkg.REMOVED.git-id @@ -0,0 +1 @@ +ab8fbbdbc303e4e566b544198a6a7ff562cbdf15 \ No newline at end of file diff --git a/src/packages/System.Data.SQLite.x86.1.0.84.0/System.Data.SQLite.x86.1.0.84.0.nuspec b/src/packages/System.Data.SQLite.1.0.84.0/System.Data.SQLite.1.0.84.0.nuspec similarity index 76% rename from src/packages/System.Data.SQLite.x86.1.0.84.0/System.Data.SQLite.x86.1.0.84.0.nuspec rename to src/packages/System.Data.SQLite.1.0.84.0/System.Data.SQLite.1.0.84.0.nuspec index 702500c2b..456c3a6b4 100644 --- a/src/packages/System.Data.SQLite.x86.1.0.84.0/System.Data.SQLite.x86.1.0.84.0.nuspec +++ b/src/packages/System.Data.SQLite.1.0.84.0/System.Data.SQLite.1.0.84.0.nuspec @@ -1,16 +1,16 @@ - System.Data.SQLite.x86 + System.Data.SQLite 1.0.84.0 - System.Data.SQLite.x86 + System.Data.SQLite (x86/x64) SQLite Development Team SQLite Development Team http://www.sqlite.org/copyright.html http://system.data.sqlite.org/ http://system.data.sqlite.org/images/sqlite32.png false - The official SQLite database engine combined with a complete ADO.NET provider all rolled into a single mixed-mode assembly for x86. + The official SQLite database engine for both x86 and x64 along with the ADO.NET provider. Public Domain en-US diff --git a/src/packages/System.Data.SQLite.1.0.84.0/content/net20/x64/SQLite.Interop.dll.REMOVED.git-id b/src/packages/System.Data.SQLite.1.0.84.0/content/net20/x64/SQLite.Interop.dll.REMOVED.git-id new file mode 100644 index 000000000..7f19a52d0 --- /dev/null +++ b/src/packages/System.Data.SQLite.1.0.84.0/content/net20/x64/SQLite.Interop.dll.REMOVED.git-id @@ -0,0 +1 @@ +860c0e580744e6c434db8d7d468f8fc15e2a41be \ No newline at end of file diff --git a/src/packages/System.Data.SQLite.1.0.84.0/content/net20/x86/SQLite.Interop.dll.REMOVED.git-id b/src/packages/System.Data.SQLite.1.0.84.0/content/net20/x86/SQLite.Interop.dll.REMOVED.git-id new file mode 100644 index 000000000..210889820 --- /dev/null +++ b/src/packages/System.Data.SQLite.1.0.84.0/content/net20/x86/SQLite.Interop.dll.REMOVED.git-id @@ -0,0 +1 @@ +6f6fd4f437e4579f5d8cd489c0d3095a7f0ebb8c \ No newline at end of file diff --git a/src/packages/System.Data.SQLite.1.0.84.0/content/net40/x64/SQLite.Interop.dll.REMOVED.git-id b/src/packages/System.Data.SQLite.1.0.84.0/content/net40/x64/SQLite.Interop.dll.REMOVED.git-id new file mode 100644 index 000000000..5453e41eb --- /dev/null +++ b/src/packages/System.Data.SQLite.1.0.84.0/content/net40/x64/SQLite.Interop.dll.REMOVED.git-id @@ -0,0 +1 @@ +cb352e8236b42cc560ee62583a5b8e0d14d87851 \ No newline at end of file diff --git a/src/packages/System.Data.SQLite.1.0.84.0/content/net40/x86/SQLite.Interop.dll.REMOVED.git-id b/src/packages/System.Data.SQLite.1.0.84.0/content/net40/x86/SQLite.Interop.dll.REMOVED.git-id new file mode 100644 index 000000000..0af219bb6 --- /dev/null +++ b/src/packages/System.Data.SQLite.1.0.84.0/content/net40/x86/SQLite.Interop.dll.REMOVED.git-id @@ -0,0 +1 @@ +1838fba8df03d11c4b76a63b922448593bc908ce \ No newline at end of file diff --git a/src/packages/System.Data.SQLite.1.0.84.0/content/net45/x64/SQLite.Interop.dll.REMOVED.git-id b/src/packages/System.Data.SQLite.1.0.84.0/content/net45/x64/SQLite.Interop.dll.REMOVED.git-id new file mode 100644 index 000000000..e5431d784 --- /dev/null +++ b/src/packages/System.Data.SQLite.1.0.84.0/content/net45/x64/SQLite.Interop.dll.REMOVED.git-id @@ -0,0 +1 @@ +26efb8ce39cf9b09e440c00d2639233402b2a154 \ No newline at end of file diff --git a/src/packages/System.Data.SQLite.1.0.84.0/content/net45/x86/SQLite.Interop.dll.REMOVED.git-id b/src/packages/System.Data.SQLite.1.0.84.0/content/net45/x86/SQLite.Interop.dll.REMOVED.git-id new file mode 100644 index 000000000..e9dc4501f --- /dev/null +++ b/src/packages/System.Data.SQLite.1.0.84.0/content/net45/x86/SQLite.Interop.dll.REMOVED.git-id @@ -0,0 +1 @@ +b937604acdc489ab2c0b89e0aaf075672e536b70 \ No newline at end of file diff --git a/src/packages/System.Data.SQLite.x86.1.0.84.0/lib/net20/System.Data.SQLite.Linq.dll.REMOVED.git-id b/src/packages/System.Data.SQLite.1.0.84.0/lib/net20/System.Data.SQLite.Linq.dll.REMOVED.git-id similarity index 100% rename from src/packages/System.Data.SQLite.x86.1.0.84.0/lib/net20/System.Data.SQLite.Linq.dll.REMOVED.git-id rename to src/packages/System.Data.SQLite.1.0.84.0/lib/net20/System.Data.SQLite.Linq.dll.REMOVED.git-id diff --git a/src/packages/System.Data.SQLite.1.0.84.0/lib/net20/System.Data.SQLite.dll.REMOVED.git-id b/src/packages/System.Data.SQLite.1.0.84.0/lib/net20/System.Data.SQLite.dll.REMOVED.git-id new file mode 100644 index 000000000..1b34b8dbc --- /dev/null +++ b/src/packages/System.Data.SQLite.1.0.84.0/lib/net20/System.Data.SQLite.dll.REMOVED.git-id @@ -0,0 +1 @@ +7bae8574bfe9fbff66f60d60987008756be04acd \ No newline at end of file diff --git a/src/packages/System.Data.SQLite.x86.1.0.84.0/lib/net40/System.Data.SQLite.Linq.dll.REMOVED.git-id b/src/packages/System.Data.SQLite.1.0.84.0/lib/net40/System.Data.SQLite.Linq.dll.REMOVED.git-id similarity index 100% rename from src/packages/System.Data.SQLite.x86.1.0.84.0/lib/net40/System.Data.SQLite.Linq.dll.REMOVED.git-id rename to src/packages/System.Data.SQLite.1.0.84.0/lib/net40/System.Data.SQLite.Linq.dll.REMOVED.git-id diff --git a/src/packages/System.Data.SQLite.1.0.84.0/lib/net40/System.Data.SQLite.dll.REMOVED.git-id b/src/packages/System.Data.SQLite.1.0.84.0/lib/net40/System.Data.SQLite.dll.REMOVED.git-id new file mode 100644 index 000000000..da6eab0b8 --- /dev/null +++ b/src/packages/System.Data.SQLite.1.0.84.0/lib/net40/System.Data.SQLite.dll.REMOVED.git-id @@ -0,0 +1 @@ +1ee930f18b364964b44e591dd81f3ce1a3615bac \ No newline at end of file diff --git a/src/packages/System.Data.SQLite.x86.1.0.84.0/lib/net45/System.Data.SQLite.Linq.dll.REMOVED.git-id b/src/packages/System.Data.SQLite.1.0.84.0/lib/net45/System.Data.SQLite.Linq.dll.REMOVED.git-id similarity index 100% rename from src/packages/System.Data.SQLite.x86.1.0.84.0/lib/net45/System.Data.SQLite.Linq.dll.REMOVED.git-id rename to src/packages/System.Data.SQLite.1.0.84.0/lib/net45/System.Data.SQLite.Linq.dll.REMOVED.git-id diff --git a/src/packages/System.Data.SQLite.1.0.84.0/lib/net45/System.Data.SQLite.dll.REMOVED.git-id b/src/packages/System.Data.SQLite.1.0.84.0/lib/net45/System.Data.SQLite.dll.REMOVED.git-id new file mode 100644 index 000000000..a509730b8 --- /dev/null +++ b/src/packages/System.Data.SQLite.1.0.84.0/lib/net45/System.Data.SQLite.dll.REMOVED.git-id @@ -0,0 +1 @@ +aa5827973b95175e31ab254ee946d7d67c914383 \ No newline at end of file diff --git a/src/packages/System.Data.SQLite.1.0.84.0/tools/install.ps1 b/src/packages/System.Data.SQLite.1.0.84.0/tools/install.ps1 new file mode 100644 index 000000000..a4293924a --- /dev/null +++ b/src/packages/System.Data.SQLite.1.0.84.0/tools/install.ps1 @@ -0,0 +1,36 @@ +############################################################################### +# +# install.ps1 -- +# +# Written by Joe Mistachkin. +# Released to the public domain, use at your own risk! +# +############################################################################### + +param($installPath, $toolsPath, $package, $project) + +$platformNames = "x86", "x64" +$fileName = "SQLite.Interop.dll" +$propertyName = "CopyToOutputDirectory" + +foreach($platformName in $platformNames) { + $folder = $project.ProjectItems.Item($platformName) + + if ($folder -eq $null) { + continue + } + + $item = $folder.ProjectItems.Item($fileName) + + if ($item -eq $null) { + continue + } + + $property = $item.Properties.Item($propertyName) + + if ($property -eq $null) { + continue + } + + $property.Value = 1 +} diff --git a/src/packages/System.Data.SQLite.x86.1.0.84.0/System.Data.SQLite.x86.1.0.84.0.nupkg.REMOVED.git-id b/src/packages/System.Data.SQLite.x86.1.0.84.0/System.Data.SQLite.x86.1.0.84.0.nupkg.REMOVED.git-id deleted file mode 100644 index 71abe40ba..000000000 --- a/src/packages/System.Data.SQLite.x86.1.0.84.0/System.Data.SQLite.x86.1.0.84.0.nupkg.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -2db1579b36b2d81adf041533845e9a72ea6c2393 \ No newline at end of file diff --git a/src/packages/System.Data.SQLite.x86.1.0.84.0/lib/net20/System.Data.SQLite.dll.REMOVED.git-id b/src/packages/System.Data.SQLite.x86.1.0.84.0/lib/net20/System.Data.SQLite.dll.REMOVED.git-id deleted file mode 100644 index 466be2a95..000000000 --- a/src/packages/System.Data.SQLite.x86.1.0.84.0/lib/net20/System.Data.SQLite.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -168e4329b21098e36b1c1af6e0c8728d5e9c589e \ No newline at end of file diff --git a/src/packages/System.Data.SQLite.x86.1.0.84.0/lib/net40/System.Data.SQLite.dll.REMOVED.git-id b/src/packages/System.Data.SQLite.x86.1.0.84.0/lib/net40/System.Data.SQLite.dll.REMOVED.git-id deleted file mode 100644 index d022f1d1f..000000000 --- a/src/packages/System.Data.SQLite.x86.1.0.84.0/lib/net40/System.Data.SQLite.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -f60b588d3ff22ae8b1f51d710a44a037683ce81d \ No newline at end of file diff --git a/src/packages/System.Data.SQLite.x86.1.0.84.0/lib/net45/System.Data.SQLite.dll.REMOVED.git-id b/src/packages/System.Data.SQLite.x86.1.0.84.0/lib/net45/System.Data.SQLite.dll.REMOVED.git-id deleted file mode 100644 index fb102879e..000000000 --- a/src/packages/System.Data.SQLite.x86.1.0.84.0/lib/net45/System.Data.SQLite.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -c62d000052745e37933833a3b764eb47ece9673f \ No newline at end of file