hydrus
hydrus copied to clipboard
Have one note assigned to multiple files so edits are reflected
While it's currently possible for one file to possess multiple notes, one note can't be assigned to multiple files in such a way where edits to the note in one place reflects the note in other places. At most you can have notes named the same with the same content until one is edited.
This should also allow you to delete a note completely from all notes it's assigned to without having to hunt down different instances of it.
I'll attach the conversation I had with dev about it below.
[22:06]Zweibafk: Hydrus Developer while a file can hold multiple notes would it be possible for one note to be held by multiple files?
[19:39]Hydrus Developer: in terms of database storage, the db is set up to store this efficiently, so yeah I think this is doable. it makes more sense for comics and paged stuff like you see on pixiv, it would just need some nicer UI to handle multi-file note editing. maybe it could work like the multi-file rating edit dialog, where if the files agree on a note/rating, it shows the thing, and if they disagree, it shows a 'grey' rating, which could be a note panel with '3 files have a note, 2 don't have it, click here to set a note for all files' kind of thing. you'd be able to edit a particular note for all files and the others would be left alone
[19:52]Zweibafk: I have no idea how it works in the databse so 🤷♂️ I was thinking that if you assign one note to several files, such as downloading from a pixiv gallery, they'd all share the resulting note and if you edit the note on one file it'd be edited on all other files sharing the note too since, ya know, it's the same note instead of identical copies [19:52]Zweibafk: There was a recent example actually [19:56]Zweibafk: So here you'd have something like a note called "MAZ537". In edit notes you have options of add, edit current, delete current. Maybe have one called create while add lets you add existing notes. So we add and then we can search notes like we do tags, probably just by note name to keep it simple but with the ability to preview so you know you're selecting the right one. So we search for "MAZ537" and add that. Editing that note anywhere edits it everywhere [19:56]Zweibafk: Maybe a clone option in case you want to make a specific copy with unique edits for whatever reason
[20:06]Hydrus Developer: Zweibafk that's an interesting idea, having the single note edit affect multiple files. I like it, but I do not think I am geared on the database level for that sort of tech right now. I'm thinking, and I'm not sure I have any metadata where if you edit it on one file, you edit it on multiple. I will think about this more, maybe there is a way of doing it nicely with current tech and database layout
[20:14]Zweibafk: So you didn't go with some id <> mapping | id <> name | id <> content structure for this? Makes notes a bit less appealing for me since it'd mean at least some unnecessary duplicate work. Not a lot for my intended usecase granted but still
[20:16]Hydrus Developer: current system is
file_id | note_name_id | note_text_id
yeah I guess to do what you are talking about, I would migrate it to:
file_id | note_id note_id | note_name_id | note_text_id
and then multiple files could take the same note edits
[20:17]Zweibafk: Of interest is also being able to delete a note completely if it's full of garbage and likely to be assigned to multiple files without having to hunt down all instances of it
[20:20]Hydrus Developer: thanks. I will think about this. I think this is too complicated for me to add any time soon, since I just did note parsing and I want to round that out and make sure what I just added works ok, but it is a nice idea. it also somewhat plays into the idea in duplicates of 'live sync' where you could join two files together and say that edits to one also make edits to another. I hadn't thought of having notes like this, so worth thinking about