From afbfd29d66987fce73dbba830b408e3ee3fa37c9 Mon Sep 17 00:00:00 2001 From: Amos Ng Date: Fri, 12 Jun 2020 23:53:21 +0800 Subject: [PATCH 1/3] Hotfix to allow for directory creation during migration --- src/main/java/mdnet/cache/DiskLruCache.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/mdnet/cache/DiskLruCache.java b/src/main/java/mdnet/cache/DiskLruCache.java index 5e2715b..91ad816 100644 --- a/src/main/java/mdnet/cache/DiskLruCache.java +++ b/src/main/java/mdnet/cache/DiskLruCache.java @@ -966,6 +966,10 @@ public final class DiskLruCache implements Closeable { // Move files to new caching tree if exists Path oldCache = Paths.get(directory + File.separator + key + "." + i); Path newCache = Paths.get(directory + subKeyPath + File.separator + key + "." + i); + + File newCacheDirectory = new File(directory + subKeyPath, key + "." + i + ".tmp"); + newCacheDirectory.getParentFile().mkdirs(); + if (Files.exists(oldCache)) { try { Files.move(oldCache, newCache, StandardCopyOption.ATOMIC_MOVE); @@ -985,6 +989,10 @@ public final class DiskLruCache implements Closeable { // Move files to new caching tree if exists Path oldCache = Paths.get(directory + File.separator + key + "." + i + ".tmp"); Path newCache = Paths.get(directory + subKeyPath + File.separator + key + "." + i + ".tmp"); + + File newCacheDirectory = new File(directory + subKeyPath, key + "." + i + ".tmp"); + newCacheDirectory.getParentFile().mkdirs(); + if (Files.exists(oldCache)) { try { Files.move(oldCache, newCache, StandardCopyOption.ATOMIC_MOVE); From dc4ff667fc2257d3f9803b0b98a0e7f7a15be677 Mon Sep 17 00:00:00 2001 From: Amos Ng Date: Fri, 12 Jun 2020 23:53:39 +0800 Subject: [PATCH 2/3] Bump version numbers --- src/main/java/mdnet/base/Constants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/mdnet/base/Constants.java b/src/main/java/mdnet/base/Constants.java index c291f91..24bdad8 100644 --- a/src/main/java/mdnet/base/Constants.java +++ b/src/main/java/mdnet/base/Constants.java @@ -3,7 +3,7 @@ package mdnet.base; import java.time.Duration; public class Constants { - public static final int CLIENT_BUILD = 3; + public static final int CLIENT_BUILD = 4; public static final String CLIENT_VERSION = "1.0"; public static final Duration MAX_AGE_CACHE = Duration.ofDays(14); } From 5928e81907b8e3387eced7038f530d9bff3c083b Mon Sep 17 00:00:00 2001 From: Amos Ng Date: Fri, 12 Jun 2020 23:54:02 +0800 Subject: [PATCH 3/3] Updated CHANGELOG.md --- CHANGELOG.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 473152a..2cf8f5e 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +## [1.0.0-RC14] - 2020-06-12 +### Fixed +- [2020-06-12] Fixed not actually creating the directories before moving cache files by [@lflare]. + ## [1.0.0-RC13] - 2020-06-12 ### Added - [2020-06-12] Added CHANGELOG.md by [@lflare]. @@ -47,7 +51,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - [2020-06-11] Tweaked logging configuration to reduce log file sizes by [@carbotaniuman]. -[Unreleased]: https://gitlab.com/mangadex/mangadex_at_home/compare/v1.0.0-rc13...HEAD -[1.0.0-rc12]: https://gitlab.com/mangadex/mangadex_at_home/-/compare/1.0.0-rc12...1.0.0-rc13 +[Unreleased]: https://gitlab.com/mangadex/mangadex_at_home/compare/v1.0.0-rc14...HEAD +[1.0.0-rc14]: https://gitlab.com/mangadex/mangadex_at_home/-/compare/1.0.0-rc13...1.0.0-rc14 +[1.0.0-rc13]: https://gitlab.com/mangadex/mangadex_at_home/-/compare/1.0.0-rc12...1.0.0-rc13 [1.0.0-rc12]: https://gitlab.com/mangadex/mangadex_at_home/-/compare/1.0.0-rc11...1.0.0-rc12 [1.0.0-rc11]: https://gitlab.com/mangadex/mangadex_at_home/-/compare/1.0.0-rc10...1.0.0-rc11