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

Add more meaningful file names #15

Open
Alfa-Q opened this issue May 26, 2023 · 1 comment
Open

Add more meaningful file names #15

Alfa-Q opened this issue May 26, 2023 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@Alfa-Q
Copy link
Owner

Alfa-Q commented May 26, 2023

Option to add more meaningful file names when saving the media. This could be done through format strings. Or just a general string.

Use the fields on the Post class in the format string. So at the moment these would be the options.

  • date
  • postid
  • copyright
  • character
  • artist
  • general

The format string would always be followed by _{count} to prevent naming conflicts. The count field is just a number that increments every time there is a duplicate name.

Example

Post(
    date = '2020-11-29 08:30:31-06',
    postid = 12345678,
    artist = [
        Tag(
            tagtype = 'arist',
            tag = 'yoshida_akihiko',
            tagname_display = 'yoshida akihiko',
            tagurl = '/search.html?q=yoshida_akihiko'
        )
    ],
    character = [
        Tag(
            tagtype = 'character',
            tag = 'yorha_no._2_type_b',
            tagname_display = 'yorha no. 2 type b',
            'tagurl' = '/search.html?q=yorha_no._2_type_b'
        }
    ],
    copyright = [
        Tag(
            tagurl: '/search.html?q=nier_(series)',
            tagtype = 'copyright',
            tag = 'nier_(series)',
            tagname_display = 'nier (series)'
        ),
        Tag(
            tagurl: '/search.html?q=nier_automata',
            tagtype = 'copyright',
            tag = 'nier_automata',
            tagname_display = 'nier automata'
        )
    ]
)

{copyright}_{character}_{artist}

"nier_series_yorha_no._2_type_b_yoshida_akihiko_0"
"nier_series_yorha_no._2_type_b_yoshida_akihiko_1"
"nier_series_yorha_no._2_type_b_yoshida_akihiko_2"

nier_automata_{artist}

This example could be useful if you already know that you queried the posts using the positive_tag nier_automata. So if there are multiple copyright tags (i.e. nier_(series) and nier_automata) then you can apply the one you prefer.

"nier_automata_yoshida_akihiko_0"
"nier_automata_yoshida_akihiko_1"
"nier_automata_yoshida_akihiko_2"

This is not a perfect solution and does have some issues... Just an idea.

@Alfa-Q Alfa-Q added this to the v2.1.0 milestone May 26, 2023
@Alfa-Q Alfa-Q added the enhancement New feature or request label May 26, 2023
@SolitarySpiral
Copy link

alternative for this feature is here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants