Open zajimumaaa opened 1 year ago
I don't see the error, to be honest.
You use the "files"
option to get attachements first in Case A, and so you have 6 attachments, and then the "normal" file, so the {num}
is obviously 7 here, and in Case B you simply ignore all attachments, so the {num}
is 1..
I mean, what did you expect?
I was expecting them to have the exact same num regardless they are included in download queue or not. Sometimes I'm not downloading the attachment when the connection is not stable and then download it on the later run. On current behaviour it's not possible because the num is not consistent. If I do the 2nd run, there will be duplicated files and unintended skipped files because the num is not reproducible.
If I use archive.sqlite instead, it will skip the first download queue eventhough it's a complete different file because the num also not consistent.
with attachment:
the 1
is the first attachment which is a zip file
without attachment:
the 1
is first file which is an image. If I run gallery-dl again with attachment on the config file, the first attachment will be skipped and the first file which has been downloaded will be downloaded again with num 7.
This probably will happen too if there's inline
file.
My request is that we can configure num
value to be based on sequence in the metadata instead of download queue so it will persist and reproducible regardless of the files
configuration,
My request is that we can configure
num
value to be based on sequence in the metadata instead of download queue so it will persist and reproducible regardless of thefiles
configuration
This can be achieved without modifying the source code. Just change your archive-format
to something that reflects the uniqueness of each file, for example:
{service}_{user}_{id}_{hash|filename|num}
Just change your
archive-format
to something that reflects the uniqueness of each file, for example:{service}_{user}_{id}_{hash|filename|num}
Thanks for the workaround.
This can be achieved without modifying the source code.
In my humble opinion, the default archive format should also make sure it's reproducible, isn't that the main functionality of archive sqlite ? to monitor which things has been downloaded or not?
In my humble opinion, the default archive format should also make sure it's reproducible, isn't that the main functionality of archive sqlite ? to monitor which things has been downloaded or not?
Yeah, but changing how num
works under the hood would break backward compatibility. The usual solution to this is to add another metadata field (pos
or seq
sounds like a good name), but its function would be largely identical to {hash|filename|num}
.
Yeah, but changing how num works under the hood would break backward compatibility
Yea, make sense.
The usual solution to this is to add another metadata field (
pos
orseq
sounds like a good name), but its function would be largely identical to{hash|filename|num}
.
In my opinion, hash
is too long (Windows have limitation regarding this if I remember correctly), filename
might not be unique and num
is not reproducible with difference config. So pos
or seq
have different purpose.
@mikf , apologize for the ping, could you add pos
or seq
variable for this purpose? is it possible?
Context: pos
or seq
is similiar to num
but the value won't change if include
config is changed. As my observation, num
is sequence in the download queue, so if include
config is changed, the value will also change because the download queue order also changed. Instead of using download queue order, pos
or seq
is using order in metadata that contain all of the possible thing that could be downloaded regarding the include
config.
num
variable value is not the same iffiles
config is different.Case A
The config below have this result:
with this metadata json:
Case B
The config below have this result:
as reference, this is the metadata.json:
TLDR Comparison
The
file
num
value is7
in Case A but in Case B it's1
. Would be nice if there's an option to make it have the same result (count the num even if it's not included to download queue)Additional Notes
Also for some reason some metadata is missing in case B. is that a bug?