Help - Search - Members - Calendar
Full Version: foo_dirwatch
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
Pages: 1, 2, 3, 4
falling down the stairs
This plugin allows you to specify directories to monitor, and notifies the Media Library of any changes (additions, renames, deletions) that occur.

Latest version: 0.2 beta 3 (2007-12-08)
Download foo_dirwatch

Known issues
- a subset of directory removes are not handled
- moved files' playlist entries are not updated (renamed files' entries are, though)
donnie

I it doesn't seem to be doing anything for me sad.gif

I have set the paths of my directories, ticked the remove deleted files from the database box and set the filters to: *.mp3;*.wma

if I then add or remove files from the directories and and select directory watcher from my components menu, the database isn't getting updated.
metal_termite
I like the idea of this plugin smile.gif

However, the plugin reuqires MSVCR70.dll to run, and I already have MSVCR71.dll in my foobar directory. I don't know what other foobar plugin uses MSVCR71.dll. I think its ColumnsUI.

Wouldn't it be better to use the newer dll?

falling down the stairs
I uploaded a new version that fixes a crash bug and removes that menu item (because it doesn't do anything).

donnie - it's not working because you have include filters set -- currently they filter out directory notifications (whoops!). To see what I mean, try renaming an mp3 -- it should receive the notification.

I'll fix the include filters as soon as I can.

metal_termite - Not really. I only have MS Visual Studio.NET 2002. A lot of other plugins also require MSVCR70.DLL, so it's not like this is a unique situation.

EDIT: I uploaded a new version that fixes the include filters.
francesco
biggrin.gif Great plug-in
thanks for your job

tongue.gif tongue.gif


on every time does foo_dirwatch monitor the directories ? every x minutes?
lupin
QUOTE(falling down the stairs @ Feb 10 2006, 03:37 AM)
Please test files that are named with multi-byte character sets (e.g., Chinese, Japanese etc.); they should work fine but I want to be sure.
*


I tested files with Chinese names, and it worked like a charm.
However, directories to be monitored cannot contain Chinese characters.
I tested a directory with a Chinese named sub-folder. The console displayed a warning quoted below.

WARNING (foo_dirwatch) : Please check directories to monitor list in options, because "E:\music\诅咒(the sub-folder)" is not a valid directory on this system.

Please fix it. THX for such a good plugin.

Sorry for my poor English.
matth6546
this is a good idea, but it doesn't seem to actually do much. when i add files to the directory, it doesn't detect them. i've tried disabling foo_dir and re-enabling it, i've tried closing and opening foobar - nothing. the only thing it does is remove a file from the database after foobar has tried to play it and discovered the file wasn't there.
francesco
it seems that foo_dirwatch doesn't work perfectly

directory to monitor
I:\Music;G:\music mp3

include mask *.mp3;*.wma;*.m4?
exclude blank

I tried to add some dirs inside music , but nothig it did not add new mp3 in the database

in the console i get only these messages
CODE
INFO (foo_dirwatch) : Added "G:\music mp3\" to directory monitor list.
INFO (foo_dirwatch) : Added "I:\Music\" to directory monitor list.
INFO (foo_dirwatch) : Started monitoring directories



DATABASE setting
G:\music mp3\;I:\Music\
Restrict file type
BLANK
enjoilax
Not working here either.
falling down the stairs
To clarify some things:

foo_dirwatch does not poll for changes; instead, it uses the Win32 API function ReadDirectoryChangesW to tell the OS to notify foo_dirwatch when changes occur. This function does not exist on Windows 9x/Me and so the plug-in will not work on those OS versions.

If the plug-in is not working for you, please list the following info:
- directories to monitor string
- include filter string
- exclude filter string
- amount of files/folders in each directory being monitored

I'll fix the directory to monitor multi-byte problem as soon as I can.
tgoose
Awesome smile.gif This is just what I wanted!
francesco
falling down the stairs i'm really grateful for the plug in


QUOTE
foo_dirwatch does not poll for changes; instead, it uses the Win32 API function ReadDirectoryChangesW to tell the OS to notify foo_dirwatch when changes occur. This function does not exist on Windows 9x/Me and so the plug-in will not work on those OS versions.



Could you make an example that i can come true ,realize, so i can know if the plugin works to me??


i tried to add directory , tried to save mp3 in new directory , tried to move directory /mp3 , but nothing , this doen't update my database

i have 817 files in 91 subfolders in one directory and 1.580 files in 176 subfolders in another directory


for me could be better , a plug that every x minutes ,can scan the database(the whole) and remove dead entries
falling down the stairs
QUOTE(francesco @ Feb 14 2006, 07:38 AM)
Could you make an example  that i can come true ,realize,  so i can know if the plugin works to me??

My setup is as follows:
Directories to monitor: F:\music;G:\music
Include filter: *.mp3;*.mp2;*.shn;*.flac;*.m4a;*.mpc;*.ogg
Exclude filter: *.jpg;*.gif;*.png;*.nfo;*.txt;*.tmp;*.bmp;*.ini

QUOTE
i tried to add directory , tried to save mp3 in new directory , tried to move directory /mp3 , but nothing , this doen't update my database

Does anything show up in the console? The plug-in prints a console message every time it adds/updates/removes something from the database.

QUOTE
for me could be better  , a plug that every x minutes ,can scan the database(the whole) and remove dead entries
*

That is not the intent of this plug-in. I don't want it to thrash the hard drive just to update the database - that would be a lot slower, plus you can already do that in foobar (Preferences / Database / Remove dead entries from database).
francesco
QUOTE
Does anything show up in the console? The plug-in prints a console message every time it adds/updates/removes something from the database.


after several testes
i get only this info from dir watch plug
CODE
INFO (foo_dirwatch) : Added "I:\mp3" to directory monitor list.
INFO (foo_dirwatch) : Added "G:\music mp3" to directory monitor list.
INFO (foo_dirwatch) : Started monitoring directories.


only 1 time, i got foo_driwatch found new songs , but it did not add to the database
falling down the stairs
I've uploaded a new version that fixes the multi-byte problem with the "directories to monitor" field.

I did notice some problems with the plug-in myself (a directory move was not caught for some reason).
If you are having problems please help me track them down with these test cases:

1. Copy a file into one of the monitored directories. (Should trigger a "Precached..." note).
2. Copy a directory into one of the monitored directories. (same as above)
3. Rename a single file in one of the monitored directories. (Should trigger a "... was renamed to ..." note)
4. Rename a directory in one of the monitored directories. (same as above)
5. Move a file from one subdirectory to another in one of the monitored directories. (Should trigger one "Precached..." and one "Removed..." note)
6. Move a directory from one subdirectory to another in one of the monitored directories. (same as above)

Be sure to list the settings you are using in the foo_dirwatch preferences.

To see if database changes did actually occur I recommend the foo_dbsearch plug-in.
francesco
user posted image


QUOTE
1. Copy a file into one of the monitored directories. (Should trigger a "Precached..." note).
2. Copy a directory into one of the monitored directories. (same as above)
3. Rename a single file in one of the monitored directories. (Should trigger a "... was renamed to ..." note)
4. Rename a directory in one of the monitored directories. (same as above)
5. Move a file from one subdirectory to another in one of the monitored directories. (Should trigger one "Precached..." and one "Removed..." note)
6. Move a directory from one subdirectory to another in one of the monitored directories. (same as above)


i did several times

CODE
INFO (foo_dirwatch) : Added "I:\mp3" to directory monitor list.
INFO (foo_dirwatch) : Added "G:\music mp3" to directory monitor list.
INFO (foo_dirwatch) : Started monitoring directories.
INFO (CORE) : opening file for playback :
INFO (CORE) : location: "file://I:\Music\Black Sabbath\Master Of Reality\01.  Sweet Leaf.mp3" (0)
INFO (CORE) : startup time: 610 ms
INFO (CORE) : opening file for playback :
INFO (CORE) : location: "file://I:\Music\Black Sabbath\Master Of Reality\02.  After Forever.mp3" (0)
INFO (CORE) : attempting to edit file info : file://I:\Music\Black Sabbath\Master Of Reality\02.  After Forever.mp3
INFO (CORE) : file info update pending / file busy on : file://I:\Music\Black Sabbath\Master Of Reality\02.  After Forever.mp3
INFO (foo_playcount) : File busy, update queued.



i did several testes but nothing mad.gif mad.gif
enjoilax
Works at deleting at least smile.gif Thanks!
c0utta
falling down the stairs,

An excellent plug-in - works seamlessly with my removable drive.

I do have issues with UNC paths, but I understand that ReadDirectoryChangesW is only for drives - can you confirm? I haven't been able to deduce whether mapping the UNC path to a drive works either.

Not being a foobar developer myself (dumb question approaching!) is it possible to perform a start-up inventory in the 'background' i.e. with a low priority thread?

Once again, thanks.

c0utta
falling down the stairs
QUOTE(c0utta @ Feb 15 2006, 09:42 PM)
falling down the stairs,

An excellent plug-in - works seamlessly with my removable drive.

I do have issues with UNC paths, but I understand that ReadDirectoryChangesW is only for drives - can you confirm?  I haven't been able to deduce whether mapping the UNC path to a drive works either.

What issues are you having? ReadDirectoryChangesW is compatible with UNC paths. There are some limitations, but the current code should work with UNC paths. I don't think mapping a drive would change anything.

QUOTE
Not being a foobar developer myself (dumb question approaching!) is it possible to perform a start-up inventory in the 'background' i.e. with a low priority thread?

Yes, that's probably the best way to do it. I haven't implemented the inventory scan because I haven't yet decided on the best way to store the relevant data.
falling down the stairs
I uploaded a new version. This one actually uses foobar's built in reader functionality, so when a file is added to the database its metadata is also automatically added.

No leads on the mysterious missing notifications, though.
Bimbo Frogger
Fantastic plugin ... it makes foobar perfect.

thank you
francesco
falling down the stairs

tha last version works like a charm !!!
Great plug in biggrin.gif biggrin.gif biggrin.gif


only 1 time it did not work i renamed a folder placebo to placebo c , and dirwatch detected the change , after immediately i re-renamed to placebo , and it did not catch it

by the way , i did several several tests and dirwatch works really like a charm

with the feature Perform startup & shutdown inventory , this plug in makes foobar really perfect without rivals biggrin.gif biggrin.gif


thanks falling down the stairs
gorman
Installing it now. If it works it's pretty much what I've been looking for in a year or so. biggrin.gif

One question: for it to work the changes to the monitored directories must happen when foobar is active?
gorman
QUOTE(metal_termite @ Feb 10 2006, 02:11 AM)
However, the plugin reuqires  MSVCR70.dll to run, and I already have MSVCR71.dll in my foobar directory. I don't know what other foobar plugin uses MSVCR71.dll. I think its ColumnsUI.

Wouldn't it be better to use the newer dll?
*

Another question, sorry. Can I have both DLLs in my components directory? I currently have only version 71, but when I launch foobar I don't get any error message from this component.
matth6546
i installed the 2/16 version, but i can't turn on "Perform startup & shutdown inventory" feature. i can't tell that this component is actually doing anything.
amiti
Is it possible to add an option for tagging automatically the date and time of the arrival for new files ?

amit.
falling down the stairs
QUOTE(gorman @ Feb 17 2006, 11:11 AM)
One question: for it to work the changes to the monitored directories must happen when foobar is active?
*

Yes; it can't (yet) detect changes made while foobar is closed.

QUOTE(gorman @ Feb 17 2006, 11:19 AM)
Another question, sorry. Can I have both DLLs in my components directory? I currently have only version 71, but when I launch foobar I don't get any error message from this component.
*

Yes, the two DLLs can coexist without problems. If you're not getting an error then you have the required DLL somewhere in your system path, although Microsoft recommends that they not be placed in the Windows\System directory.

QUOTE(matth6546 @ Feb 17 2006, 01:04 PM)
i installed the 2/16 version, but i can't turn on "Perform startup & shutdown inventory" feature. i can't tell that this component is actually doing anything.
*

That's because that functionality hasn't been implemented yet. To see that the component is working, take a look at the console output, or use foo_dbsearch to query the database.

QUOTE(amiti @ Feb 17 2006, 01:51 PM)
Is it possible to add an option for tagging automatically the date and time of the arrival for new files ?
*

It's theoretically possible, but practically it could cause some problems. For example, if a file is being downloaded to disk, the plug-in will receive a notification when the download first starts, but we wouldn't want to write tags to it yet. At the moment I can't think of a reliable way to overcome this.
Fractal_Mortality
QUOTE
Is it possible to add an option for tagging automatically the date and time of the arrival for new files ?

QUOTE
It's theoretically possible, but practically it could cause some problems. For example, if a file is being downloaded to disk, the plug-in will receive a notification when the download first starts, but we wouldn't want to write tags to it yet. At the moment I can't think of a reliable way to overcome this.
*



Well, then... Just design the plugin for people who have an incoming files directory seperate from their music biggrin.gif

Seriously... I do this, and I don't see the reason most people could'nt as well. Just make a directory for all incoming music that isn't under the Foobar database.
amiti
QUOTE
It's theoretically possible, but practically it could cause some problems. For example, if a file is being downloaded to disk, the plug-in will receive a notification when the download first starts, but we wouldn't want to write tags to it yet. At the moment I can't think of a reliable way to overcome this.


I think everyone has to make their own decisions about which files getting into their database , whether to use a tmp folder or to use a tmp extension to the files. it doesn't change the fact of an actual one exact time stamp of the entrance of a any file to the database.

Amit.
falling down the stairs
I gave it some more thought, and figured out a way to do it that should work in both cases. Got any suggestions for the tag name/format/number of tags?
amiti
i know that foo_filedate uses the a tag %ADDED% with the option to choose between two dates formats : YYYYMMDD and YYYY-MM-DD

foo_playcount uses different approach for adding tags of date and time. here is a part of the options section of this plugin for choosing date and time tagging :

user posted image



Amit.
francesco
when will be available scan at startup and at close of foobar
david_dl
QUOTE(amiti @ Feb 18 2006, 07:51 AM)
Is it possible to add an option for tagging automatically the date and time of the arrival for new files ? 

amit.
*



The file system already stores this, "Created" in the file properties dialog. I'm not sure how easy it would be to read this in foobar, it may require a plugin to implement a new tag, if titleformatting doesnt already cover it.
amiti
foo_filedate can import the creation time from the file , but many times it is not the same as the time it is added to library.
Duble0Syx
I have noticed one small issue with this plugin. Not sure if it supposed to be this way or not though. When moving files into the watched directory it picks them up, in the console it says it precached them. But in the database/album list the tags are not present until the files are played. Only when looking at the directory structure in the album list can I see the new files. Perhaps it is because they are flac file and so the tags are at the end of the file and it picks them up when the copying begins rather than finishes. That or dirwatch just doesn't work like that. Hope this is either intentional or fixable, as this is a great plugin. smile.gif
enjoilax
Newest version doesn't detect anything for me, except deletion.
falling down the stairs
QUOTE(francesco @ Feb 18 2006, 05:50 AM)
when will be available scan at startup and at close of foobar
*

I don't know. It's not just a matter of writing some code; I have to figure out the best way of doing it first.

QUOTE(Duble0Syx @ Feb 18 2006, 03:31 PM)
I have noticed one small issue with this plugin.  Not sure if it supposed to be this way or not though.  When moving files into the watched directory it picks them up, in the console it says it precached them.  But in the database/album list the tags are not present until the files are played.  Only when looking at the directory structure in the album list can I see the new files.  Perhaps it is because they are flac file and so the tags are at the end of the file and it picks them up when the copying begins rather than finishes.  That or dirwatch just doesn't work like that.  Hope this is either intentional or fixable, as this is a great plugin. smile.gif
*

This only occurs because the OS notifies of the addition when the copy starts, but (as you surmised) the tag is at the end of the file, so it isn't there to be read by the plug-in. I may be able to fix this, but it probably won't be a very elegant solution.

QUOTE(enjoilax @ Feb 18 2006, 04:11 PM)
Newest version doesn't detect anything for me, except deletion.
*

You had the same problem in a previous post. Did any version ever work for you? What OS are you running? Are your directories to monitor UNC paths (or mapped network drives)?
Duble0Syx
QUOTE(falling down the stairs @ Feb 18 2006, 02:50 PM)
QUOTE(Duble0Syx @ Feb 18 2006, 03:31 PM)
I have noticed one small issue with this plugin.  Not sure if it supposed to be this way or not though.  When moving files into the watched directory it picks them up, in the console it says it precached them.  But in the database/album list the tags are not present until the files are played.  Only when looking at the directory structure in the album list can I see the new files.  Perhaps it is because they are flac file and so the tags are at the end of the file and it picks them up when the copying begins rather than finishes.  That or dirwatch just doesn't work like that.  Hope this is either intentional or fixable, as this is a great plugin. smile.gif
*

This only occurs because the OS notifies of the addition when the copy starts, but (as you surmised) the tag is at the end of the file, so it isn't there to be read by the plug-in. I may be able to fix this, but it probably won't be a very elegant solution.
*


Perhaps just tell it to what until any copy operations are complete? Doesn't the OS know when each file is done copying? It has to update the TOC everything something changes I thought, so there should be some trigger for it to know "this file is done, now start copying the next one". I'm no programmer though. It seem reasonable, as the filesize isn't shown properly until the is finished, so something is updating the OS. Maybe something as simple as a delay in caching the file info, like 1 minute or something adjustable? Great work though, it's still very useful my WavPack collection since those use APEv2 tags.
francesco
enjoilax

i'm sure the plug-in works

i tried it on different pc , and in every pcs it works perfectly
post your setting , run foobar2000 with the plug loaded , and rename a directory , and look the console
gorman
QUOTE(Duble0Syx @ Feb 18 2006, 10:31 PM)
When moving files into the watched directory it picks them up, in the console it says it precached them.  But in the database/album list the tags are not present until the files are played.  Only when looking at the directory structure in the album list can I see the new files.  Perhaps it is because they are flac file and so the tags are at the end of the file and it picks them up when the copying begins rather than finishes.  That or dirwatch just doesn't work like that.  Hope this is either intentional or fixable, as this is a great plugin. smile.gif
*

Nope, the same happens to me with both flac and mp3 files. I tend to use the database/artists list and the plugin doesn't seem to work with that either.
Duble0Syx
QUOTE(gorman @ Feb 20 2006, 04:58 AM)
QUOTE(Duble0Syx @ Feb 18 2006, 10:31 PM)
When moving files into the watched directory it picks them up, in the console it says it precached them.  But in the database/album list the tags are not present until the files are played.  Only when looking at the directory structure in the album list can I see the new files.  Perhaps it is because they are flac file and so the tags are at the end of the file and it picks them up when the copying begins rather than finishes.  That or dirwatch just doesn't work like that.  Hope this is either intentional or fixable, as this is a great plugin. smile.gif
*

Nope, the same happens to me with both flac and mp3 files. I tend to use the database/artists list and the plugin doesn't seem to work with that either.
*


Plus I don't know what I was thinking when I said flac tags are at the end of the file, as they are vorbis comments and are at the beginning of the file. APEv2 tags are at the end of the file. Either the plugin isn't telling the database to read the tags or it's telling it to read the tags before the file is readable (finished copying).
falling down the stairs
I've uploaded a new version. The plug-in will now spawn a thread if it can't read the file metadata on the first attempt. The thread will retry every 1/2 a second. No other changes have been made.

Let me know if you have any problems.
Duble0Syx
QUOTE(falling down the stairs @ Feb 26 2006, 08:45 PM)
I've uploaded a new version. The plug-in will now spawn a thread if it can't read the file metadata on the first attempt. The thread will retry every 1/2 a second. No other changes have been made.

Let me know if you have any problems.
*


Just gave it a shot and I am quite pleased. I wasn't entirely sure about it starting a new thread until I watched what it was doing in the console. Good idea, as it works great. Only one question though; What happens if it is never able to read the tags? Say if a file were corrupted. Would the thread automatically terminate after a while? Not a very likely or common scenario, but maybe a 5-10 minute limit on it trying. Great work though. Saves me the trouble of having to add file to the playlist after moving them. biggrin.gif

EDIT: Also doesn't every 1/2 second seem a bit frequent? Maybe it's just me, as I don't know what kind of affect that can have on the system load or anything else. No complaints though. Perhaps make it adjustable?
falling down the stairs
QUOTE(Duble0Syx @ Feb 27 2006, 02:05 AM)
Just gave it a shot and I am quite pleased.  I wasn't entirely sure about it starting a new thread until I watched what it was doing in the console.  Good idea, as it works great.  Only one question though; What happens if it is never able to read the tags?  Say if a file were corrupted.  Would the thread automatically terminate after a while?  Not a very likely or common scenario, but maybe a 5-10 minute limit on it trying.  Great work though.  Saves me the trouble of having to add file to the playlist after moving them. biggrin.gif
*

The reader succeeds when trying to read corrupted files; it's only when it can't access the file (file not found or access denied) that it fails. If the file gets deleted while the thread is running, it will detect this (and the thread will terminate).
T&L
Thanks for a nice plug-in smile.gif , for me it works well except for a one thing:

If I first rename a folder and then move it inside another folder (both are in monitored directories), the plug-in notifies the first change, but there is nothing in console about the last one and the database has the old information...

For example: monitoring D:\foo\, renaming D:\foo\album-2006 to D:\foo\album(2006) and the plug-in notifies it, but then (quite soon after renaming) I move the folder to D:\foo\bar\ so a new path is D:\foo\bar\album(2006), and there is absolutely nothing in console about this happening. dry.gif
However if I rename (without moving to a different location) another folder in that D:\foo\bar dir, the plug-in works correctly, so it is actually monitoring this directory too.
rectangle
Great plug-in. Works well for me. Thanks smile.gif
amiti
hello , i guess my earlier suggestion for adding the %ADDED% tag haven't been implemented to the plugin (i hope the idea wasn't dumped).
after rethinking about this , it seems to me that replaygain calculation is another action that would benefit if it happens when the files are added to database. maybe there are other actions others might think of too.

Amit.

Klato
One of the reasons I stopped using foobar2000 was because I could never find a way to automatically update my library. This plugin seems nice!
queenaudio
I find that the plugin works well when I move individual MP3's into my watched folder, however If I drag a whole dir into it (e.g. a dir with a whole album), it doesn't pick it up. Great plugin tho and I sure it can only get better!

G.
francesco
biggrin.gif

When can we test the final version?

QUOTE
Known issues:
- Startup/shutdown scan not implemented



i'm waiting with anxiety the final version , with startup scan foobar has not rivals biggrin.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.