Modify directory.watch.added and add directory.watch.removed command#616
Modify directory.watch.added and add directory.watch.removed command#616chros73 wants to merge 2 commits intorakshasa:masterfrom
Conversation
|
The limitation of "removed" is arbitrary, and it is not very flexible, e.g. does not take care of re-ties. The better / more consistent way would be to fire an And then the next logical step is call it And the special path '*' would mean "all existing directory.watch.added dirs". Finally, let the old super-special tied/untied commands as-is, deprecate them wholesale, and add |
|
And while looking at that |
|
See #374 (comment) about why you do not need more than the handler name as an argument. |
|
A.
I agree, although it's working fine:
About the events: it's an interesting idea, but somebody else has to implement it :) . |
|
B.
Thanks, it didn't work for me for whatever reason when I tried (otherwise probably I wouldn't have modified it).
Anyway, @rakshasa will decide it. |
One of the advantages of using "inotify" to load and remove downloads by torrent meta files is the reduced file system IO (apart from it's instant).
Refers to: #374
A. Modify
directory.watch.addedAllow it to accept multiple commands (as
load.*commands).There are multiple ways to achieve this but since there's no "shortcut" (the directory (that is watched) for inotify has to be separated), the final command (that is called on an "add" event) is reconstructed as a line of config.
load.*commands),parameter separator) then it needs to be included inside quotes (")B. Add
directory.watch.removedSimilarly to loading event, add ability to handle removing events of meta files as
*_untiedcommands:*_untiedcommands can't deal with a download individually: they go through and check all the downloads (they can generate lot of IO, especially if they are used withschedulecommand)directory.watch.removedhandles this individuallySince it doesn't need any additional commands, it accepts multiple directories as parameters.
d.stop,d.close,d.erasedirectory.watch.removed = d.erase, (cat,(cfg.dir.meta_compl),various/), (cat,(cfg.dir.meta_compl),unsafe/)C. Rename
*tiedcommandsRename untied commands and add redirects for the new names to preserve compatibility:
start_tied->tied.startstop_untied->untied.stopclose_untied->untied.closeremove_untied->untied.removeD. Limitations
directory.watch.addedordirectory.watch.removedE.
directory.watch.*commands in actionLet's assume the following: