Catalina deleted all my Audiobooks!

From Wurst-Wasser.net
Revision as of 18:57, 9 February 2020 by Heiko (talk | contribs) (More on that matter)
Jump to: navigation, search

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 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!

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 the 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.

#!/bin/bash
#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 
		mv "${LINE}" "${GTARGETFOLDER}/${ARTIST}/${BOOK}/"
	done # done find
done # done extensions

# EOF

The hard part: Extracting all Other Audiobooks

TBD

More on that matter...