Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support tumblrgallery.xyz #1298

Merged
merged 8 commits into from
Mar 3, 2021
Merged

support tumblrgallery.xyz #1298

merged 8 commits into from
Mar 3, 2021

Conversation

topozorra
Copy link
Contributor

I am not sure how to write tests for this project please let me know if I need to change it.

@topozorra
Copy link
Contributor Author

@rautamiekka I am not sure what you mean. For post processing it is easy to know what is the id. If I spilt the filename by "_" I know the id with extension is the last element of the array.
The reason I add title to the filename is to get the "Post" name, because search page is returning with a list of posts, and I wanted to create folder for every posts and put the files in it. ( I wrote a little script to do that because I didn't find the way in galley-dl to create multiple folders while downloading the files.)

@rautamiekka
Copy link
Contributor

@rautamiekka I am not sure what you mean. For post processing it is easy to know what is the id. If I spilt the filename by "_" I know the id with extension is the last element of the array.
The reason I add title to the filename is to get the "Post" name, because search page is returning with a list of posts, and I wanted to create folder for every posts and put the files in it. ( I wrote a little script to do that because I didn't find the way in galley-dl to create multiple folders while downloading the files.)

If the post contains the underscore you'll fuck up the split, and/or if the post contains an integer, it'll also fuck up the detection. For that reason, you musta all easily detectable parts before the one you can't too simply detect. I know from multiple 1st-hand experience with files I named something like that.

@topozorra
Copy link
Contributor Author

I think knowing it is always the last one is safe as knowing it is always the 3rd one. but I understand it is can be confusing.
I had "_" in my gallery names the work around was simple:

    const fileNameParts = fileName.split("_");

    fileNameParts.shift()
    fileNameParts.shift()
    const galleryId = fileNameParts.shift();
    const fileHashWithExt = fileNameParts.pop();
    const galleryName = fileNameParts.join('').replace(/\s/g, "-").replace(/(\-+)/g, "-").replace(/\.+$/, "");

I will commit a change to put the title at the end.

@rautamiekka
Copy link
Contributor

^ I'm glad you were able to see reason :)

@topozorra
Copy link
Contributor Author

Is there anything I need to add to this branch to make it ready to merge?

@mikf mikf merged commit a9119da into mikf:master Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants