Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

iTunes media files location

First of all, I know exactly where iTunes stores its stuff and how to tell it where to do so as I've been doing this since before Apple even purchased the app in the first place. However, it has just started behaving strangely.


As we know, iTunes can be set to use a specific 'Media' folder (which it is) and media files will then be stored in subfolders of their content type. So music files are stored in …/Media/Music, movies in …Media/Movies etc. I have iTunes set to keep its library organised and so far it has always done so. But…


This morning I just noticed some music files (in their Artist/Album folders) stored in the Media folder and not in the Music subfolder. I changed the type of these to Podcast and they were moved correctly to the Podcast subfolder. Change the type back to Music and they are moved back to the Media folder again. WTF?


In all these years I have NEVER seen iTunes do this. It has always religiously followed its configuration and placed all media files in the appropriate sub folder. Why can it possibly now think it should place these music files in the Media folder itself?


Anyone any ideas about this?

Mac Pro, macOS 10.14

Posted on Dec 11, 2022 1:42 AM

Reply

Similar questions

9 replies

Dec 21, 2022 3:06 AM in response to UKenGB

See my user tip Make a split library portable - Apple Community where I describe the two layouts in a little more detail. The default layout in iTunes 8 and earlier put artist folders in the main media folder, previously called iTunes Music. iTunes 9 added something called iTunes Media Organization, changing the media folder name to iTunes Media and adding the Music subfolder for artist folders to go into. They didn't automatically rearrange existing libraries, but added the function under File > Library > Organize Library > Rearrange Files to do this. Using this option will reorganize files inside the designated media folder to the new layout. The process is one way, meaning there isn't a control to swap back to the old layout, although that is possible by tweaking a value from 1 to 0 in a hidden file in the media folder called .iTunes Preferences.plist, then turning Keep organized off and on again. As noted earlier I believe your .plist file has been regenerated somehow with the wrong value, causing iTunes to use the old layout when updating file locations.


As for metadata that won't update see another of my user tips: Repair security permissions for iTunes for Mac - Apple Community.


tt2

Dec 13, 2022 12:49 PM in response to UKenGB

Good day to you UKenGB, 


It looks like you’re using iTunes for Mac, based on the community for your post and not the Music app. Which macOS version are we working with? 


The next thing we’d like to know is whether you had a chance to consider what, if anything, the songs you noticed moved might have in common. For example, recently played, recently synced, perhaps they had new updates to album artwork, etc. 


You had mentioned that you store your library on an external hard drive. When you were moving files, are they being stored back on the external, but in the iTunes Media folder or are is the iTunes Media folder on your local hard drive? 


Thanks. 

Dec 14, 2022 1:27 AM in response to AnnieL2

Mojave with iTunes 12.9.5 (latest available).


The only thing the songs have in common is that I 'Consolidated' them or opened a Get info window. Both of which means that iTunes moves the files into where it thinks they should be and in the case of files type Music, that is now in the Media folder and not Media/Music where they should be.


Did I say the files are on an external drive? It is an internal drive, just not the main Startup Disk. iTunes prefs point to the correct folder on that drive and everything has worked that way for over 10 years, no problem whatsoever. Well, not that iTunes doesn't have its quirks, but in this respect it has always behaved impeccably, when configured to do so (which it is) storing all media files in their respective sub folder in the the Media folder. Until recently.


As I said, Consolidate files means iTunes will move them to where it thinks they should be. Likewise if you 'Get info' it will check the file's location and instantly move it to where it thinks it should be, if not already there. Also if you change a file's type, it will again move it to where it thinks it should be according to that type, i.e. music files in the Media/Music folder, podcasts in Media/Podcasts, etc. This all works as expected - EXCEPT for music files which it clearly now thinks should be in the Media folder and NOT Media/Music. Any of the above actions on ANY file and iTunes does move it to the expected sub folder in Media, except music files. Change to type Podcast and the file is moved to the Media/Podcasts folder. Change it back to Music and it is moved to the Media folder.


For some unaccountable reason, iTunes now thinks that files of type Music should be stored in the actual Media folder which it has only recently started doing and is clearly wrong.


This occurs with Any file(s) I try.


I quit iTunes and deleted all its pref files and restarted. No change, still doing it wrong.


Restarted the Mac and as expected, still same problem.


Ran iTunes (same version) from a full backup (cloned) disk, made before I ever noticed this problem. Same problem.


Tried same iTunes from the cloned disk, but using the library on that cloned drive - same problem.


However, I cannot guarantee that the clone was made before the problem actually started as I have not been doing anything with the music files for quite some time. So it is possible the problem began some time ago, but was not apparent as I had not touched the files. I did start working with the files about a week ago and that's pretty much when I noticed the problem.


It has occurred to me that the later Music app does store the music files in its Media folder, as other file types are stored elsewhere anyway so no need of the sub folders as used by iTunes. Is it possible there was an actual iTunes update fairly recently that introduced this aspect of Music.app, either intentionally or unintentionally? Dumb idea either way, but a bit of a stretch to think some later Music.app code somehow migrated into an iTunes release.


The version reported by iTunes is 12.9.5.5 (although just 12.9.5 shown in Finder). Is this a recent update? I don't have obvious access to an earlier version to test.


One thing that I do recall is a few days ago, probably about the time I first noticed the issue, I had a problem with iTunes. It froze and I had to Force Quit. It started back up no apparent problem, but it's the sort of thing that can create odd problems. However, since I have tested a copy of iTunes, and a library file from before that Force Quit event and also with new prefs, I cannot see how it can be connected.


Basically, something has changed within iTunes that makes it think Music type files should be stored in its Media folder and not Media/Music and I'm still at a loss to figure out why and how.


BTW, to prevent this occurring every time I try and look at any track's info, I have removed write permissions from the Media folder, so iTunes now CANNOT move files there. Since the type sub folders (e.g. Media/Music) are still writable, it should still work ok, but no doubt there will be some unexpected repercussions from this sledge hammer solution. Hence I still need to figure out what on earth is going on here that is making iTunes behave like this.

Dec 21, 2022 12:28 AM in response to turingtest2

I am reluctant to try that as currently iTunes clearly thinks Music should be placed in Media and 'Rearrange Files' in my experience moves files to where it thinks they should be, so it will simply move ALL my music files up to the Media folder. That's over 25k files so it it went wrong, it could be something of a nightmare.


I could back it all up first for sure, but I am trying to explore all other avenues first.


Having said all that, does 'Rearrange Files' actually give any instruction to iTunes as to where the files need to be? Does it not simply move them, as I said, to where it already thinks they should be? Would it actually change where it thinks that is?


It is also clear that iTunes hasn't forgotten everything about media types locations. It's only Music type files about which it seems confused. If I change the type to anything else, iTunes moves the file(s) into the correct subfolder. It is only files of type Music that cause the problem. If it had truly reverted to pre v9 behaviour, surely it wouldn't know where to put those other file types.


I would be very keen to hear from anyone still running Mojave, which will be iTunes 12.9.? and see exactly how iTunes behaves for them.

Dec 21, 2022 12:46 AM in response to turingtest2

One other point I think worth mentioning.


The is one other BIG flaw in iTunes. Some years ago it stopped reliably writing metadata/tags back to the media files. It used to be that when you changed something in iTunes, that change would ALWAYS be written back to the file. iTunes was a terrific tagger. Then, some years ago, it stopped doing this reliably. It always saves the changes to its own database (Library file) so all looks good, but it may, or may not write that info back to the actual files. I guess the developers figure that once in the iTunes eco system, it's not necessary to keep the files in sync and hence can make iTunes faster if it doesn't have to keep writing data back to the files. I think it's an appalling abrogation of its responsibility to accurately handle media file metadata, but, I have come to terms with it and adjusted how I deal with my media to suit iTunes new lazy behaviour.


However, in all other respects, iTunes behaves impeccably and pretty much always has. I am not running some sloppy collection of random media. I have an extremely carefully curated music collection and I assiduously maintain the data tags/metadata, both within iTunes and also within the files' metadata. Nothing has changed regarding this for many years. Now, this odd file location behaviour suddenly manifests itself and I cannot figure out why it is doing what it is and why it has just started doing it for no apparent reason.

Dec 21, 2022 4:59 AM in response to turingtest2

Yay! Sorted.


I was unaware of that hidden pref file. I'd tried deleting all prefs files as it seemed to me like some sort of prefs corruption, but no knowing about that one meant it remained and hence so did the aberrant behaviour.


Having now seen that this hidden plist was set to 0, I simply quit iTunes, edited the plist to 1 and restarted iTunes. Since all the media files were in the right place, no re-organisation was required and even with write permissions granted on the Media folder, nothing is moved as iTunes now knows the correct place for the Music files.


I am amazed that after all these years, I did not know about that plist. Or maybe I did and had completely forgotten. Wouldn't be the first time. Anyway, thank you for the information, this bizarre behaviour is no more. Thanks again.


I will look into your information on the writing metadata to files issue.


iTunes media files location

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.