~q3cpma/mangadex-tools

16ff8ac6abb0e276b8411ac92c00bd6a1671467d — q3cpma 2 months ago 5659a30
monitor: check for directory permission even without -autodl-dir
mdex_util: handle non integer volume numbers
2 files changed, 16 insertions(+), 3 deletions(-)

M mdex_monitor.tcl
M mdex_util.tcl
M mdex_monitor.tcl => mdex_monitor.tcl +2 -1
@@ 96,7 96,8 @@ if {$single_feed} {

if {$autodl_dir eq ""} {
	set autodl_dir $datadir_path
} elseif {![file isdirectory $autodl_dir]} {
}
if {![file isdirectory $autodl_dir]} {
	util::die "$autodl_dir: directory not found"
} elseif {![file writable $autodl_dir] || ![file executable $autodl_dir]} {
	util::die "$autodl_dir: permission to access or write denied"

M mdex_util.tcl => mdex_util.tcl +14 -2
@@ 119,7 119,13 @@ proc chapter_dirname {chapter_data lang {title ""}} {
	}
	set vol [dict get $chapter_data data attributes volume]
	if {$vol ne "null"} {
		append ret " ([format v%02d $vol])"
		if {[string is entier -strict $vol]} {
			append ret " (v[format %02d $vol])"
		} elseif {[string is double -strict $vol]} {
			append ret " (v[format %04.1f $vol])"
		} else {
			append ret " (v$vol)"
		}
	}
	set group_names [get_rel_groups [dict get $chapter_data relationships]]
	append ret " \[[join $group_names {, }]\]"


@@ 133,7 139,13 @@ proc cover_filename {cover_data lang {title ""}} {
	set ret "$title - c000"
	set vol [dict get $cover_data data attributes volume]
	if {$vol ne "null"} {
		append ret " ([format v%02d $vol])"
		if {[string is entier -strict $vol]} {
			append ret " (v[format %02d $vol])"
		} elseif {[string is double -strict $vol]} {
			append ret " (v[format %04.1f $vol])"
		} else {
			append ret " (v$vol)"
		}
	}
	set ext [file extension [dict get $cover_data data attributes fileName]]
	append ret " - Cover$ext"