Difference between revisions of "Catalina deleted all my Audiobooks!"

From Wurst-Wasser.net
Jump to: navigation, search
(What worked for me)
(More on that matter...)
Line 71: Line 71:
* This is a desaster!
* This is a desaster!
* Storing lotsa GB of Audiobooks in <code>~/Library/Containers/com.apple.BKAgentService</code> is insane!
* Storing lotsa GB of Audiobooks in <code>~/Library/Containers/com.apple.BKAgentService</code> is insane!
* I only add the books I'm about to read to Books.app
* ''I only add the books I'm about to read to Books.app''
* I expect Podcasts will be the same nightmare!
* I expect Podcasts will be the same nightmare!
* Links
* Links

Revision as of 09:47, 11 February 2020

What? It deleted all the Audiobooks? No, not really. But hid them well and left it to me to remedy the situation.

The Problem

Upgrading from Mojave to Catalina was mostly harmless. Fitting for an earth-made OS. :-) At some time (I guess it was opening Books), Catalina tried to move all my Audiobooks from iTunes (now Music) to iBooks (now Books). Since my iTunes Library is on an USB-drive, and the iBooks-Library is on the internal SSD (with obviously less space) this failed. That wouldn't be so bad, if the AudioBooks where still usable in iTunes.

The Analysis

  • Q: Are they still in iTunes?
  • A: Can't find them in Music-App.
  • Q: Have the files been left over?
  • A: Try find . -name \*.aa\* -print in your Music/iTunes Library. In my case, it found all my Audible-Audiobooks (.aa)

So, they are still there...

The Solution

What doesn't work #1

CatalinaBooksMusic01.png CatalinaBooksMusic02.png This is really annoying. This stupid app doesn't even tell me how much I should free. Absolutely useless.

What doesn't work #2

$ ln -s /Volumes/Daten\ HD\ \(Portable\ Samsung\ 2TB\)/Users/SOMEONE/Music/Audiobooks/Audiobooks /Users/SOMEONE/Library/Containers/com.apple.BKAgentService/Data/Documents/iBooks/Books/

Alias doesn't work, too![1]

What worked for me

I decided to salvage only the Audiobooks from Audible (386 files), and let the rest stay in the iTunes Library. Why, you ask? It's pretty simple. I added loads of kid's CDs to my iTunes Library, so the kids can play them on iPod Touches instead of CD-Players. Now the but: GracenoteDB and similar services come in handy when adding CDs, but...one CD can have more than one artist (worst case, another for each track), iTunes sorts (more like "spreads") the contents of the CD in multiple Artist-Folders in iTunes Library...

The easy part: Extract all Audible Audiobooks

This script will move all Audible Audiobooks to another location. From there, you can add them (as needed) to Books.

#set -x

GITUNESLIB="/Volumes/Daten HD (Portable Samsung 2TB)/Users/SOMEONE/Music/iTunes/iTunes Music"
GTARGETFOLDER="/Volumes/Daten HD (Portable Samsung 2TB)/Audiobooks Salvaged After Catalina-Fuckup"
GEXTENSIONS=".aa" # m4b=Apple, aa=Audible
#GEXTENSIONS=".m4b .aa" # m4b=Apple, aa=Audible

# Find Audiobooks
for EXT in ${GEXTENSIONS}; do
	echo "Searching for \"${EXT}\"..."
	find "${GITUNESLIB}" -name \*${EXT}\* -print | while read LINE; do
		echo "Found: $LINE"
        	BOOK="`echo \"${LINE}\" | rev|cut -d/ -f2 | rev`"
        	ARTIST="`echo \"${LINE}\" | rev|cut -d/ -f3 | rev`"
#         	echo "Book: $BOOK"
#		echo "Artist: $ARTIST"

		# Create Parent Folders
		mkdir -p "${GTARGETFOLDER}/${ARTIST}/${BOOK}"

		# Move Audiobook 
	done # done find
done # done extensions


The hard part: Extracting all Other Audiobooks

I tried different approaches, but ended up with the most obvious:

  • Mount the disk containing the iTunes Library on a VM with Mojave
  • Use old iTunes to export the Audiobooks using a Script I originally developed for AppleScript Launcher[2]
    • Create a (Smart) Playlist with all the Audiobooks to export
    • Select all items
    • run Export Selected Tracks….applescript[3]
    • Optional: Delete the exported items from your Library

More on that matter...

  • Tried everything I could think of: restarting BKA-Daemon, rebooting...Nothing worked.
  • This could also be done with bash and mp3info, but the grouping and Metadata of iTunes are more accurate.
  • AppleScript: Export Selected Tracks….applescript