INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Excluding data folders from auto library imports  (Read 2452 times)

kane2

  • Recent member
  • *
  • Posts: 9
Excluding data folders from auto library imports
« on: June 25, 2019, 01:31:18 pm »

I saw this was asked for MC23, but never really addressed.

There needs to be a way to exclude specifically named data folders that can appear within the directory for a specific album. Many other programs create these folders, usually with specific names, and they purposely contain files that look like music but aren't.  The best way would be for MC to have a grep like exclude in the auto import list for a library.
So if the Music Directory is structured something like

~/Music/Artist 1/Album 1/

          Song 1
          Song 2
          Song 3
          Song 4
          Song 5
          Song 6
          data_folder/
          Pure Music Bookmarks/

~/Music/Artist 2/Album 2/

          Song 1
          Song 2
          Song 3
          Song 4
          Song 5
          Song 6
          data_folder/
          Pure Music Bookmarks/

Your auto import list could look like

~/Music/
--exclude "*/Pure Music Bookmark/*"
--exclude "data_folder"

so MC would ignore anything it finds in folders with these names (kind of how "rsync" works). On my computer EVERY ONE of hundreds of albums contain this kind of information. Unfortunately there is no scripting interface on the Mac and the Web Services Interface doesn't offer a way to remove a file from the library, just playlists.

Any ideas or help would be appreciated. Right now MC25 thinks every other track it found is a song, and it simply stops when it gets the fake data in these folders.

         Jeffrey
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Excluding data folders from auto library imports
« Reply #1 on: June 26, 2019, 08:59:31 am »

Ouch.  That doesn't sound like fun.

Question:  Do these files have extensions that look like audio files?  Meaning do they end in ".mp3", ".aac", ".flac", etc?  If so, that seems like a really poor design decision

Agreement with you:  It would be nice to have a way to exclude things using a regex or wildcard or something similar for cases like yours.

Workaround:  Since all of the files you want to exclude are in directories with regimented names, you can easily delete all of those entries from MC.  Just do a search for one of the common directory names like "Pure Music Bookmarks".  Use the double quotes so that it takes all the words, in order, as a group.  Without the quotes it will match on all instances of each word in all monitored fields.

Then when it shows all of the "wrong" files, you can just delete them from MC by highlighting all (Command-a) and pressing delete to remove them.

I would do this search from Audio > Files, or a similar files based view that shows filename.  That way it's easy to check to see you are selecting the files you want.

Please make a library backup first!  Double check yourself before deleting a huge number of files.  If you screw up, restore your library backup.

Finally, when doing a delete operation, you'll get a box that asks you if you want to delete just the library entry, or actually delete the file itself.  In this case you only want to delete the library entry and leave the file on disk alone.

Good luck,

Brian.
Logged

kane2

  • Recent member
  • *
  • Posts: 9
Re: Excluding data folders from auto library imports
« Reply #2 on: June 29, 2019, 09:26:39 am »

The same problem was posted a year and a half ago without any good resolution <https://yabb.jriver.com/interact/index.php?topic=114092.0>

The files  contained in these directories look like music files as they are used to fool iTunes into playing flac entries. The above thread was trying to eliminate indexing folders named _gsdata_. I was playing with creating a smart play list using the 'Filename(path) contains "Pure Music Bookmark.pmbmf"', but I can't figure out how use the resulting list to trim the library itself. Also I cant find a way to create the auto-import scripts that might be able to have an exclude command it them. Removing similar files or folders from a library shouldn't be this hard after 25 versions of the program.

I would think I could just select the list of files, and select some command that would remove the library entries, but I can't find ANY method of doing that

Any thoughts on how to use the results of this smart playlist to remove them from the library would be GREATLY appreciated.

                     Jeffrey
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72439
  • Where did I put my teeth?
Re: Excluding data folders from auto library imports
« Reply #3 on: June 29, 2019, 10:44:09 am »

When you set up auto import, you can choose a directory and then exclude it.  Or you can tell MC which type of files to import from it.
Logged

kane2

  • Recent member
  • *
  • Posts: 9
Re: Excluding data folders from auto library imports
« Reply #4 on: June 29, 2019, 03:41:18 pm »

We aren't talking about a single folder or two. Every Album directory contains one of these folders (Hundreds of directories total) all filled with small files that appear to be music (but aren't). Comes out to thousands of songs.  I can find them using the smart play list and Filename(path) contains.... , but can't figure out how to tell the library to then forget all the songs in the smart playlist.

This doesn't solve the ongoing issue for new music that is added, there really should be a grep like way to do this either in the auto-import program (either via the wizard, or by creating and auto-import preference file that would contain what files to include, and what patterns to exclude.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72439
  • Where did I put my teeth?
Re: Excluding data folders from auto library imports
« Reply #5 on: June 29, 2019, 03:55:33 pm »

MC has tools you can probably use. 

You can import any file and then change it to a document type in the Media Type.

You can also move files, using logic, with the tool called Rename, Move, and Copy.

You can probably select what you want by using the search as a filter.  For example, if the sub-directory was always named littlefiles, you could search for that or you could put a minus sign in front of it to show all but those sub-directories.

The wiki has helpful information.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Excluding data folders from auto library imports
« Reply #6 on: June 30, 2019, 11:08:31 am »

I can find them using the smart play list and Filename(path) contains.... , but can't figure out how to tell the library to then forget all the songs in the smart playlist.

Well that part is easy.  Just select all in the playlist (Command-a) and then press delete.  That will bring up a dialog asking you what to do.  Take the default which is to remove from library.  That will leave the files on disk, but remove them from MC's inventory.  MC will not try to reimport them again because it keeps track of what you remove.

Brian.
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Excluding data folders from auto library imports
« Reply #7 on: June 30, 2019, 08:36:46 pm »

This doesn't solve the ongoing issue for new music that is added, there really should be a grep like way to do this either in the auto-import program (either via the wizard, or by creating and auto-import preference file that would contain what files to include, and what patterns to exclude.

Post a list of all the extensions of the files that you do not want to be imported. You have mentioned only one, "pmbmf".


On the thread you mentioned, user jeraldej posted that the issue was resolved, and it looked like a perfect solution to me, for his issue.
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Excluding data folders from auto library imports
« Reply #8 on: July 01, 2019, 01:20:57 pm »

On the thread you mentioned, user jeraldej posted that the issue was resolved, and it looked like a perfect solution to me, for his issue.

Unfortunately this won't work for the OP.  Our OP here in this thread has these "weird" directories inside EVERY album directory.  So he has hundreds of them and will have more every time he adds new albums.  Thus the need for some kind of exclude expression or similar.  Kind of an odd case, but it's certainly a valid need/desire to fix it.

Brian.
Logged

kane2

  • Recent member
  • *
  • Posts: 9
Re: Excluding data folders from auto library imports
« Reply #9 on: July 03, 2019, 10:32:46 am »

Post a list of all the extensions of the files that you do not want to be imported. You have mentioned only one, "pmbmf".


On the thread you mentioned, user jeraldej posted that the issue was resolved, and it looked like a perfect solution to me, for his issue.

The files contained in these folders have extensions so they appear to look like music files (.m4v, .mp4, etc) but they are NOT music files. iTunes sees them and tricks it so that iTunes can play flac output. That's why Media Center needs to ignore ANYTHING it finds in a folder with the given name in it's path. As said there are hundreds of these folders (one for every album).
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72439
  • Where did I put my teeth?
Re: Excluding data folders from auto library imports
« Reply #10 on: July 03, 2019, 10:38:45 am »

Changing MC seems like a kludge to fix a problem with another kludge.

Is that something iTunes supports or is it supported by another app?
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Excluding data folders from auto library imports
« Reply #11 on: July 03, 2019, 12:50:20 pm »

@kane2

It occurs to me that if all of these folders were in one tree with only FLAC files, then we could easily fix this by telling MC "in this directory tree, only import FLACs".  Then it would ignore all the rest of the "phony" extensions and files.

That would mean a structure that looked something like this:

Your Music/FLAC/Artist1/Album1
Your Music/NotFLAC/Artist2/Album2

I have my collection separated that way because I wanted to get rid of all of my MP3s and other lossy file types.  So I put them in different top level directories to help me with organization.

If your file types are all under one common directory structure, then this isn't as easy.  MC can probably help you if you want to move all FLACs to a new top level directory (keeping the existing Artist/Album/whatever structure too).

Of course this would mean that ITunes would lose track of all of your media then and would have to re-import it in it's new location.

Which brings up a good question:  Are you planning to keep using ITunes?  If so, I have to ask why you would use both MC and ITUnes.  They are quite different and most MC users kind of scorn ITunes.  If all of this is a huge workaround to keep using ITunes, the best answer might be to dump ITunes since MC can do almost everything it can (other than talking to iphones and ipods).  Or maybe my "move all FLACs" idea.

Thanks,

Brian.
Logged

kane2

  • Recent member
  • *
  • Posts: 9
Re: Excluding data folders from auto library imports
« Reply #12 on: July 03, 2019, 03:18:30 pm »

Other programs and computers use the iTunes Music Library, which is why iTunes needs to know about it (Apple's homepod and sharing of music to other Apple devices, such as ipods, or iphones) depend on iTunes knowing and cataloging the files. The ability of excluding certain named data folders, is a general solution to this and other problems.  A great example is the way rsync works, it's ability to exclude certain names of directories is of paramount importance. MC just assumes that everything in a Musics hard disk structure is to be imported, or excluded on a case by case basis. Giving a grep like --exclude would allows MC to play nicely with that hard disk so that it can be shared with other programs and utilities. This large music file directory is networked (NASH) and shared by other computers (of various operating systems) running different programs, depending on the hardware playing the music. Even the ability to call out to a small program with the file path to return a true or false to importing would be great (it could even by a python, ruby, bash command or scripting language, anything like that) would allow you to do this. The ability doesn't have to be within MC.
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Excluding data folders from auto library imports
« Reply #13 on: July 03, 2019, 06:35:46 pm »

Even the ability to call out to a small program with the file path to return a true or false to importing would be great (it could even by a python, ruby, bash command or scripting language, anything like that) would allow you to do this. The ability doesn't have to be within MC.

Sorry, but that is just getting silly. MC would still have to know to call out to an external program, and would have to accept the result coming back. I don't work for JRiver, but if I did, I would never consider that. Particularly to support third party functionality, and a kludge at that.

The wildcard idea isn't a bad one, but have you noticed how MC only allows you to select existing folders for import, and validates each folder as you enter it? Of course, you can add a folder through the Browse functionality, but you can still only select an existing folder, even if you just created it. A change to using wildcards would require big internal changes.


If you wish to support multiple iDevices and Apple technology applications, why don't you just convert your FLAC files to ALAC? MC plays both, and you could potentially simplify your whole music management process. I just had a quick read on the Pure Music Bookmark solution. Ahhh!!!


But if you really must maintain iTunes for iDevices, and don't want to convert your FLACs to ALACs (which I believe would be a lossless conversion), and therefore want to keep using the Pure Music solution, just let MC import all those extra files, and then exclude them from all View and Smartlist definitions. They will be there, but you won't see them in MC.

-[Filename (path)]="data_folder"
-[Filename (path)]="Pure Music Bookmarks"

In English, those expressions say 'The path does not contain "data_folder"', for example. Including both those in all your View and Smartlist definitions will hide all files stored in those folders and any subfolders. It would be a bit of work to add those to all View and Smartlists, but not too onerous.
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

kane2

  • Recent member
  • *
  • Posts: 9
Re: Excluding data folders from auto library imports
« Reply #14 on: July 06, 2019, 05:24:49 am »

Unfortunately ALAC files max out at a much lower resolution than flac so that's not really an option.

Adding a simple call out via a straight forward API to a little code snippet and acting on it's return value is not difficult to add from a technical viewpoint. I've done this for countless programs over the years. I understand that this isn't a feature that you need, but the actual disk with the media files is a shared resource and this would just help MC play nicely when working with many types of programs (metadata programs, catalog, other players or streaming software, etc)  that also use that resource and act on the data. None of this is MCs fault, but it reflect the reality of a shared area and that it can get a little messy. I have numerous servers using the same library.

Another solution might be  to add terms such as you suggest right into the auto import rules. The current interface for auto-import VERY simple (just a directory path), and the ability to use those general kinds of terms (tags that return values) already exists within MC.

I like your solution, but I'm assuming you mean to add that individually to each smart playlist that exists. I was talking about keeping things out of the libraries to begin with, so the program can truly ignore them.
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Excluding data folders from auto library imports
« Reply #15 on: July 06, 2019, 06:39:52 pm »

Yes, I was talking about adding the exclusions to every View and Smartlist individually. It is a solution that exists today, and meets your requirement, except for the data being in the Library.

But that doesn't matter. The Library is fast and doesn't require disk access to individual files or external programs. The Library was recently made even faster, after a user with 800,000 audio files provided a copy of his Library and some optimisations were found. So having a whole bunch of these extra files in your Library, unseen, should not be an issue for MC.

Try it.
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

kane2

  • Recent member
  • *
  • Posts: 9
Re: Excluding data folders from auto library imports
« Reply #16 on: July 08, 2019, 07:26:55 am »

They already have a check box to "ignore special files" on the auto-import dialog. It doesn't define what all the file names that they use are, it just gives folder.jpg as an example. They could just simply offer a list of files name and also allow you to enter your own (including folder names) to avoid. The mechanism for this feature is already in the product.
Logged

kane2

  • Recent member
  • *
  • Posts: 9
Re: Excluding data folders from auto library imports
« Reply #17 on: July 28, 2019, 01:00:33 pm »

They already have a check box to "ignore special files" on the auto-import dialog. It doesn't define what all the file names that they use are, it just gives folder.jpg as an example. They could just simply offer a list of files name and also allow you to enter your own (including folder names) to avoid. The mechanism for this feature is already in the product.

Does anyone know where this information is stored? What are the other file names (since they only give folder.jpg as the example) that MC ignores with this check box, and how can we see to the list?
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Excluding data folders from auto library imports
« Reply #18 on: July 28, 2019, 01:48:25 pm »

It seems to me having these extraneous directories is not a problem, even if they are scattered through thousands of other folders, as long as they are named using a well defined scheme.

Simply import the whole lot, use a search view to list everything in the directories that match a search expression, then delete them.  It's the work of two minutes.
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Excluding data folders from auto library imports
« Reply #19 on: July 28, 2019, 08:01:47 pm »

The mechanism for this feature is already in the product.

No, it isn't. The special files are files that MC knows are part of its library processes, such as Cover Art image named {filename}.jpg and .png, and external tag files like {filename}_JRSidecar.xml, and most files associated with the JTV recording format. There is no list of files to be excluded so that they can be viewed, edited, or added to. It is all done in code.

You have been given two very viable solutions for the issue you have. Why don't you use one of them? Deleting the library records of the directories requires ongoing maintenance, but is very easy. Customising your Views, Smartlists etc. takes a bit more work up front, but requires no ongoing effort.


I know your proposed solutions seem simple and easy to implement, but haven't we mentioned the word "Kludge" often enough yet? I don't think JRiver is going to implement any of them.

To quote JimH, who is the owner and CEO of JRiver, "Sorry".
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

kane2

  • Recent member
  • *
  • Posts: 9
Re: Excluding data folders from auto library imports
« Reply #20 on: November 30, 2019, 08:21:11 am »

I saw this was asked for MC23, but never really addressed.

There needs to be a way to exclude specifically named data folders that can appear within the directory for a specific album. Many other programs create these folders, usually with specific names, and they purposely contain files that look like music but aren't.  The best way would be for MC to have a grep like exclude in the auto import list for a library.
So if the Music Directory is structured something like

~/Music/Artist 1/Album 1/

          Song 1
          Song 2
          Song 3
          Song 4
          Song 5
          Song 6
          data_folder/
          Pure Music Bookmarks/

~/Music/Artist 2/Album 2/

          Song 1
          Song 2
          Song 3
          Song 4
          Song 5
          Song 6
          data_folder/
          Pure Music Bookmarks/

Your auto import list could look like

~/Music/
--exclude "*/Pure Music Bookmark/*"
--exclude "data_folder"

so MC would ignore anything it finds in folders with these names (kind of how "rsync" works). On my computer EVERY ONE of hundreds of albums contain this kind of information. Unfortunately there is no scripting interface on the Mac and the Web Services Interface doesn't offer a way to remove a file from the library, just playlists.

Any ideas or help would be appreciated. Right now MC25 thinks every other track it found is a song, and it simply stops when it gets the fake data in these folders.

         Jeffrey

This same problem has come up again, this time with multiple versions of the same song. I would be happy to write a plug-in that allowed you to select whether or not a file was imported into the library, say importing only the high res version for one library and the lower if it wasn't available.  As I said below, there seems to be some kind of mechanism for this already within the program.  The API can be VERY simple. If anyone from JRiver can comment on this, I would be appreciative.

I also appreciate that RoderickGI proposed and thinks he has come up with a solution that works long term, but it doesn't, so please don't keep reiterating that particular solution. I program apps for a living, so I fully understand the amount of work that is required. This is a solution to a LARGE NAS storage that constantly has new music added; his solution requires continued ongoing manual maintenance, where a simple filter would take care of it once and for all.

Thanks for any help

Logged
Pages: [1]   Go Up