advplyr / audiobookshelf

Self-hosted audiobook and podcast server
https://audiobookshelf.org
GNU General Public License v3.0
6.8k stars 480 forks source link

[Enhancement]: Button to save cover to folder with files and/or delete a local cover #1548

Open hobesman opened 1 year ago

hobesman commented 1 year ago

Describe the feature/enhancement

I often have a cover saved to the folder with the files, but if the search finds a better one, I'd like an option to save it to the folder with the files.

Most of the time I think I'd prefer that it be added to the list of local covers, rather than replacing the existing ones, but maybe also add a button to delete a local cover.

So in the end, two things:

  1. The active cover and searched covers would add a hover button (perhaps a floppy disk) to save to local folder.
  2. The local covers add a trash can icon to remove them from the local folder.
advplyr commented 1 year ago

The server setting to save covers with library items handles saving to local folder but will replace any other cover with the name "cover". With your suggestion what would be the file naming schema for these downloaded covers?

hobesman commented 1 year ago

I'd forgotten about the option to save cover with files, but (a) I don't necessarily want to lose the cover I have, (b) with multiple local covers it isn't clear which one would be deleted since it doesn't show their file names on the cover search/selection screen, and (c) if the active cover appears the same, I don't know if it's the same resolution or a higher/lower resolution than what I already have in the folder.

As for how to name the additional covers, it could be as simple as appending "-#" if cover.jpg already exists. Rotate through the numbers and use the first non-conflicting result. So cover-1.jpg, then cover-2.jpg and so on.

advplyr commented 1 year ago

I'm not sure it would be obvious that the button is saving the file to the folder of your library item. This would probably require an additional confirmation. Also, since we support single-file audiobooks in the root directory it would be hidden for those, which seems okay.

hobesman commented 1 year ago

Perhaps for those in the root, maybe show an asterisk explanation of why it's disabled. Just to avoid confusion.

For the confirmation, could there be a check box to skip future confirmations or something, so it isn't every single time if you already understand?

advplyr commented 1 year ago

Possibly. Will need to think about this one. I think there is another feature request related to multiple covers as well

hobesman commented 1 year ago

Ah I just found this. https://github.com/advplyr/audiobookshelf/issues/1204

It's similar in concept, but wants to save multiple files to the metadata folder instead of saving with the audio files. That difference might also require clarification if both options are implemented.

Maybe call it "save to server" or something generic, and then depending on whether "save covers with books" is enabled, it either saves to the /metadata folder or the audio folder.

The warning in server settings about cover.jpg might need rewording. Maybe a second toggle, whether subsequent covers should be added to or replace cover.jpg