#cbt #cbz #cbr

bin+lib comic-book-binder

A helper to manage your comic books and others sorted list of files

1 unstable release

0.1.0 Nov 8, 2019

#1070 in Filesystem

GPL-3.0-or-later

24KB
146 lines

comic-book-binder (cbb)

This software aim at helping you manage your comic book library. It take care of renaming each page of a book so they are in the same order no matter the operating system or software reading the files. To achieve this, the "number" part of the page's filename is padded with 0, this way we do not have strange sort like 1.png, 10.png, 11.png, 100.png, 2.png, 20.png,

State

The software is still in early developments. I'm using it as a way to introduce myself to the rust programming language. Do not hesitate to give me feedback on how to write more idiomatic rust code.

Usage

The simplest way to use this program is to simply call it on a comic folder. This way it will ensure the pages are formatted with just the right number of leading 0 to pad the number part of the page.

$ cbb comic/

You may want to customize the number of leading 0, it is useful when you plan on adding more pages later.

$ cbb comic/ --pad=3 --dry-run
1.png	-> 001.png
8.png	-> 008.png
3.png	-> 003.png
4.png	-> 004.png
6.png	-> 006.png
2.png	-> 002.png
9.png	-> 009.png
5.png	-> 005.png
11.png	-> 011.png
7.png	-> 007.png
10.png	-> 010.png

TODO

  • Add tests: I am not used to create tests on projects (unit & integration)
  • Add tests: HELP WANTED: how can I tests operations on the filesystem?
  • Add some quality of life features:
    • Dry-run: Show how the files will be changed without modifying anything
    • Recursivity: user select a "library" folder for which each sub-folder is considered to be a comic book (or an other library)
    • Prefix (name pattern?): let the user set the prefix of the pages: Useful when the name contains a number: "Name-Season5-Chapter02-Page10.png" => prefix = "Name-Season5-Chapter02-Page"
      • Deduce the prefix from the file name: try to find the invariant part and the bumping number (nice to have, not sure it is used that often)
    • Rename: Totally erase the current name of the file to replace with the cross-platform numerotation based named. The input list should be sorted (possibly coupled with the option prefix/name pattern to have a powerfull renaming tool)
  • Integrate an archive crate to be able to open/create .cba, .cbr .cbt, or .cbz archives
  • Add documentation
  • Maybe integrate rayon (test with a benchmark if it really help: part 1 of the tool is listing the files, part 2 is based on os::rename operations)

Also I saw on Wikipedia that it is possible to include metadata such as artists, story information, table of contents or even a separate text layer for comic book translations. If the feature is requested I could check if the different way to include this metadata are well spread. This however will not be discussed before (almost) releasing the 1.0.

Dependencies

~6MB
~112K SLoC