Closed Leeingnyo closed 2 years ago
I found that there's a bug after rename a directory entry and scan.
Fixed.
Since I mentioned it in the linked issue, I guess this pr does not yet do anything in regards to not treat any 2nd+ level folder like a chapter?
@tr7zw Hi!
you mean that the nested-folder
in the sample would be a problem, and it shouldn't be treated as an entry because it has another titles and zipped entries though it has image files, right?
I think the responsibility of configuring a library is up to the library owners. If they don't want this, they would remove those files.
Huh I guess never mind? I still had in mind that if you have a folder "Manga" and in that folder a folder "One Piece" with the chapters inside, I think in the past it treated the "Manga" folder as something containing Chapters. But apparently this was already fixed, now it shows Titles/Entries. Still a really neat pr, since using directories as chapters allows some more flexibility, and with the new abstract Entry class it could allow some nice new features(other compressed files than .zip, dynamically loading chapters from urls/network shares).
Thanks @Leeingnyo! I fixed the linter warnings and took a quick look, and it looks good overall! I think it's a nice application of abstract classes.
Re class names, yeah I think ArchiveEntry
is more appropriate than ZippedEntry
because we also support RAR/CBR files. I think DirectoryEntry
looks fine. We could also use DirEntry
to make it shorter but I have no strong feelings.
Also I think it makes more sense to break the classes into individual files, e.g., entry.cr
, zipped_entry.cr
, and directory_entry.cr
. What do you think?
I will do a full review and some testings later this week :+1:
Hey @Leeingnyo sorry for the delay. I made quite some changes to the PR. Can you take a quick look when you have the time to make sure I didn't accidentally fuck up anything? Thanks!
@hkalexling sorry I pushed errors occurred version... wait for a moment
@hkalexling it looks great. I like the method that you did to recover entry instances :)
Since @page
was added to Entry
, it caused an error to recover old library.yml.zip
file. But, I don't mind of this. fine!
Thanks @Leeingnyo! Sorry the comments above was just for my own reference and I accidentally published them ;-P
Since @page was added to Entry, it caused an error to recover old library.yml.zip file.
Could you elaborate a bit on this? I tried the following steps but didn't see the error.
library.yml.gz
master
branch to regenerate the library.yml.gz
fileOh that's the difference. I built it from the dev
branch. but I had the same error when I tried from the master
branch.
[ERROR] 2022/06/05 15:02:04 | Missing YAML attribute: path at line 14, column 7
because my ubuntu snap upgrades a Crystal implicitly, I use a Crystal 1.4.1... this would be a matter. :p
Ah sorry my bad. It does happen on master
on Crystal 1.0.0
as well, but it's a minor issue and will only happen once so I think we are fine.
Thanks <3
Resolve #215
What I did
Entry
class to abstract class,DirectoryEntry
, which treats unzipped images in a directory as an entryDirectoryEntry
whenTitle#new
andTitle#examine
are called.Result and test
Here is an test library environment.
In tree view,
Result
The directories appeared as entries and titles
What I tested
About class name
ZippedEntry -> ArchiveEntry DirectoryEntry -> ?
I can't come up with good names...