mirror of
https://github.com/mitb-archive/filebot
synced 2025-03-09 22:09:47 -04:00
Fix sort order
This commit is contained in:
parent
0bd3c01d18
commit
3f0f16c81d
@ -28,19 +28,14 @@ void createThumbnail(original, thumb) {
|
||||
}
|
||||
|
||||
|
||||
void createIndexFile(db) {
|
||||
def indexFile = _args.outputPath.resolve("images/${db}/thumb/poster/index.txt")
|
||||
def index = indexFile.dir.listFiles{ it.image }.collect{ it.nameWithoutExtension as int }.toSorted()
|
||||
|
||||
index.join('\n').saveAs(indexFile)
|
||||
execute '/usr/local/bin/xz', indexFile, '--force'
|
||||
|
||||
println "Index: ${index.size()}"
|
||||
indexFile.dir.listFiles{ !it.image }.each{ ls it }
|
||||
void printIndex(db) {
|
||||
def files = getThumbnailPath(db, 0).dir.listFiles()
|
||||
log.info "[INDEX] $db ${files.size()} (${byteCountToDisplaySize(files*.length().sum())})"
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void build(ids, section, db, query) {
|
||||
ids.each{ id ->
|
||||
def original = getOriginalPath(section, id)
|
||||
@ -60,11 +55,6 @@ void build(ids, section, db, query) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!artwork) {
|
||||
original.createNewFile()
|
||||
ls original
|
||||
}
|
||||
|
||||
if (!original.exists()) {
|
||||
artwork.findResult{ a ->
|
||||
return retry(2, 60000) {
|
||||
@ -77,6 +67,12 @@ void build(ids, section, db, query) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// create empty placeholder if there is no artwork
|
||||
if (!original.exists()) {
|
||||
original.createNewFile()
|
||||
}
|
||||
|
||||
ls original
|
||||
}
|
||||
|
||||
@ -86,7 +82,7 @@ void build(ids, section, db, query) {
|
||||
}
|
||||
}
|
||||
|
||||
createIndexFile(section)
|
||||
printIndex(section)
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user