JimmXinu / FanFicFare

FanFicFare is a tool for making eBooks from stories on fanfiction and other web sites.
Other
762 stars 165 forks source link

"Crossover" genere gets readded when updating from column #884

Closed WovenTales closed 2 years ago

WovenTales commented 2 years ago

I have add_genre_when_multi_category set in my INI, and for setting up and testing my config, I've been repeatedly running "Update metadata from stored column". This combination seems to add a new "Crossover" item each time it's run, so I wind up with:

Genre:

  • Fan Fiction
  • Crossover
  • Crossover
  • Crossover
  • Crossover
  • Crossover
  • Crossover
  • Crossover

I've not tried other setups so I don't know if this holds true for add_category_when_multi_category as well, but I it doesn't seem happen when the metadata is updated from the website (likely since it's being overwritten).

I don't know if it's relevant, but I also set include_in_genre: genre, extragenres. This was the first way I found to get both of them to show up, but I don't know if it has anything to do with the repeat. (I wouldn't expect so, since the extragenres value "Fan Fiction" is only included once, but I don't know the internals.)

JimmXinu commented 2 years ago

You're right--it's only an issue with "Update metadata from stored column". And even then, it will only show up outside the saved data column if you have keep_in_order_genre:true set. The normal de-duping will take care of it.

The add_genre_when_multi_category and add_category_when_multi_category code are in separate places due to add_category_when_multi_category needing to be done after all other category processing.

I'm adding a check to both to only add when it's not already in the list. add_category_when_multi_category also gets a sort step (when needed) and is applied when keep_in_order_category:true.

Test versions posted.

WovenTales commented 2 years ago

That's solved it, thanks!