TMC is an independent, primarily volunteer organization that relies on ad revenue to cover its operating costs. Please consider whitelisting TMC on your ad blocker and becoming a Supporting Member. For more info: Support TMC

Easy iTunes playlist syncing for Tesla USB flash drive

Discussion in 'Model S: User Interface' started by majorlance, Mar 5, 2015.

  1. SW2Fiddler

    SW2Fiddler We Are Cognitive Dissidents

    Joined:
    Mar 19, 2014
    Messages:
    2,337
    Location:
    Houston TX
    1. Thanks once again to Lee, Reputation Point added, and others nudged to do the same. Until a better way is found to appreciate this work.
    2. It looks like XLD by itself will rip a CD to FLAC (if someone wants a USB of a few albums, wants the high quality, but is not worried about playlists)? Anyone use it stand-alone? I'd downloaded an "AudioConverterPro" for Mac but haven't even installed.

    I do like my tunes, symphonies, dubs, hoedowns, barbershops, etc. and in the car is when I have a chance to enjoy music - but have so many CDs that it will be a project to do it all. With Lee's scripting effort to automate it, and a quiet mobile "listening lab" (Back Warmer Included) to play it in, I'm actually glad I haven't ripped my CD collection to iTunes yet.
    Sometimes procrastination ROCKS!

    Rick
     
  2. majorlance

    majorlance Member

    Joined:
    Sep 22, 2014
    Messages:
    204
    Location:
    Bethesda, MD
    Sometimes re-running the sync will correct any errors. Time Machine seems to interfere with the sync operation, not certain why. And Applescript error trapping is not the most robust (nor are my programming skills :) )

    I'm glad it's working better!

    - - - Updated - - -

    Rick,

    Thanks much! And I agree that the Tesla is the one place I can listen to whatever I want, and as loud (or soft) as I want... Nice.

    Lee
     
  3. Pollux

    Pollux Active Member

    Joined:
    Jul 16, 2013
    Messages:
    1,540
    Location:
    Merry land / District of Confusion
    I think I figured out which track didn't sync error-free: The Beatles' 1 album, in the edition I purchased from iTunes, has an extra "track" that has some kind of value-add stuff in it. Rather than a type of "Purchased AAC audio file", it has a type of, "iTunes LP". I didn't really need it in my playlist anyway, so I just deleted it.

    Life is good.

    Thanks!

    Alan
     
  4. ra-san

    ra-san Member

    Joined:
    Dec 26, 2008
    Messages:
    296
    Location:
    San Diego, CA
    I've released a new version of my utility. Latest can always be found at TeslaTunes Latest Release or linked from the project page at Tesla Tunes

    Here are the release notes:
    I'd like feedback from anyone that finds this useful, in particular anything that gets in the way of easier use and, given the limitations of the Model S in regards to playlists, whether the structure I do putting the playlists into individual folders and naming the playlist tracks to preserve order is useful vs. a longer mangled name and flat structure in combination with MajorLance's genre hack. I'm considering at least putting an option in to do the genre hack, but still think keeping the structure and naming as I'm doing them is more useful since it preserves playlist item order and keeps things more organized. Also, let me know if there are any playlist/track filenames that cause issues. I'm "sanitizing" the filenames, since they are created from track metadata and could contain illegal characters, but so far most everything I've come across actually works fine, including parenthesis, brackets, etc.

    Reminder, I wrote this for my own use to get the job done, for me and my library. I've tested it more than I would a one-off script or something, but still minimally compared to what I would a commercial project. If it breaks, you get to keep both halves.
    That said, I'd like to make it better and more useful, and certainly want to fix any problems, so let me know.
     
  5. SilverL

    SilverL Member

    Joined:
    Feb 15, 2014
    Messages:
    58
    Location:
    Parsippany, NJ
    Great release!
     
  6. Jeffgtx

    Jeffgtx Member

    Joined:
    May 20, 2014
    Messages:
    253
    Location:
    West coast
    I'm having trouble figuring one thing out. If you don't use the genre hack for the playlists, how are they played in the tesla?
     
  7. ra-san

    ra-san Member

    Joined:
    Dec 26, 2008
    Messages:
    296
    Location:
    San Diego, CA
    #47 ra-san, Apr 14, 2015
    Last edited: Apr 14, 2015
    You use the play by folder option in the S. This will let you play the playlist in order, or you can use shuffle with it.

    As I understand it, the only functionality of the genre hack is because album art was, for some reason, not showing up as consistently from the play by folder choice. In my experience, album art is flaky regardless :/

    Looking at adding the genre thing now though, as a checkbox option. I'll be pushing a new build soon regardless, because I discovered I had some library items named starting with an underscore, and the current release had code in it that skipped directories starting with a '.' or a '_'. I'm not sure what I was thinking when I did that, but I'm sure it made sense at the time :)
     
  8. ra-san

    ra-san Member

    Joined:
    Dec 26, 2008
    Messages:
    296
    Location:
    San Diego, CA
    Things went easier than I feared, and I think I now have the option "Set playlist items' genre to playlist name", aka the genre hack, implemented.
    I did this while sitting in a waiting room, so can't test with my library at the moment, but should be able to later tonight. If things work well, I'll bundle up another release tonight.
     
  9. ra-san

    ra-san Member

    Joined:
    Dec 26, 2008
    Messages:
    296
    Location:
    San Diego, CA
    Release is up. Genre mapping is in.

    Prior links to latest or project page TeslaTunes Latest Release or Tesla Tunes are still the way to get it.

    Version is bumped to 1.1.0 since it (if you check the option) changes the behavior of the genre mapping. Also has some bug fixes, so if you grabbed a previous release, grab this one.

    There's a new screen shot, but it's pretty much just an extra checkbox :)
     
  10. majorlance

    majorlance Member

    Joined:
    Sep 22, 2014
    Messages:
    204
    Location:
    Bethesda, MD
    ra-san,

    Great job. I plan on testing this weekend. The song names in my script consisted of a combination of playlist/artist/album/song/genre plus the unique identifier in iTunes. If anyone of those were changed in iTunes, the song would be replaced by the updated copy. I included the unique identifier to help when I de-duped songs using a third party app (in may case, Song Sergeant) which would sometimes replace a file with better audio quality but keep the original tags. This helped force a re-sync as the identifier changed. Only mention this as a method to force a new copy (you're application may have a different approach?).

    I'd keep the folder/playlist setup as it really doesn't matter unless you're using folder view, in which case you'll want it.

    Also glad to see the higher bit rate support. I think that songs from HDTracks.com or PonoWorld.com in higher sample rates and that have been remastered, do sound better than standard lossless files. And storage is cheap!
     
  11. Jeffgtx

    Jeffgtx Member

    Joined:
    May 20, 2014
    Messages:
    253
    Location:
    West coast
    running the program now. will probably take all night, so hopefully my morning commute will be my first in over a year with my library.

    i think the advantage of the genre/playlist swapping is that you don't have to go through all the artist folders to get to the playlist you want.

    i'm pretty excited. thanks for driving each other to create a great solution.
     
  12. ra-san

    ra-san Member

    Joined:
    Dec 26, 2008
    Messages:
    296
    Location:
    San Diego, CA
    In mine, it's a simple existence check. I don't check modification dates or anything like that. I didn't figure the use case of getting better versions of songs you already have with the exact same name, album, etc. was something that ws very likely, vs. the mod date on the source being updated for some other unimportant reason, which would then mean I'd be doing unnecessary copies. Only way to force new copies is to delete or change the destination.

    I'd be interested to know if "smarter" checking for whether or not to copy is something that would be useful for people. Same with deleting items no longer in the source but in the destination - I don't do that and specifically didn't want to in the case of my whole library copy. But for playlists I currently will delete items deleted from a playlist (figure that's probably a common use case). I don't currently delete whole playlists at the destination that are no longer in the source - I've mixed feelings about it. It's not hard to manually delete them, and didn't want to delete folders someone may have added manually

    I kind of saw things, based on my usage pattern, as being you'd copy a bunch of stuff the first time you used it, then after that it'd mostly be quick updates to grab the new media you've acquired, and you'd probably just start it and (since all your selections from last time are reloaded) hit do it. Done. I didn't attempt to handle the cases of updating already existing media, or deleting media you don't want copied over any more. Figured it's unlikely to happen, and in the rare occasion it does, scrap the destination and redo it all overnight. That doesn't work if it's not rare though. Open to feedback.

    I do kind of wonder what would be best to do next though. My thoughts right now are, in addition to any bug fixes that are needed:
    * fix the playlist view look - some mismatched backgrounds and such, just cosmetic
    * make it so you can click anywhere on the line to select the playlist
    * autoupdate notification
    * detail progress view, sort of like you can click the Safari or iTunes progress/disclosure button and pop up a list of operations and status
    * playlist folder management, as in if you deselect a playlist, it'll remove it from the destination playlist folder - feature or misfeature? Looking for feedback.
    < pause to regroup and consider what to change>
    * windows version
    * linux version

    Not sure how useful a windows version will be (much less a linux version). How many people actually use apple lossless on windows and also own a Model S and care enough to bother with something like this. If you don't use Apple Lossless, not really sure what someone would really be looking for in a utility that doesn't already exist in one of the many available. For Linux, I'd expect even fewer use Apple Lossless (probably already do FLAC directly), installed base lower, and otherwise same comments as Windows applies.
    Are there Windows users out there just pining for something specific in a util like this? If so, what?

    - - - Updated - - -

    You won't have to go through all the artist folders the way I do it now (and you should clean up the destination to match the new way, if you've ran the first couple versions). There's a playlist folder, and in it are the individual playlist folders (and only them - all music from the folder/library copy is under the Music folder). Inside each playlist folder is a flat directory structure, no subfolders, and each filename has a numeric start, with enough digits to make sure the sort order is maintained (1 digit if <10 items, 2 if <100, etc.). From that folder view you can play your "playlist" in order, or you can hit shuffle. There's no digging around further, from that view. I don't really see anything the genre thing adds except possibly better album art handling - but I know that can be a big thing to people.
     
  13. Jeffgtx

    Jeffgtx Member

    Joined:
    May 20, 2014
    Messages:
    253
    Location:
    West coast
    pretty happy with the results. moved about 9000 files last night.

    i was going to pop on here with a few questions, but i think you already answered them.

    I was going to suggest having the genre hack remove the genres from songs that were not part of a playlist, but i see your folder solution takes care of that. i guess i might even stop using the genre hack then, but i'll have to think about that.

    also, i am not sure how the tesla catalogs things, but will it find songs regardless of the file structure for the song view? the reason i ask is I am not sure if i am supposed to have a music folder and then the artist stuff in that folder or get rid of the music folder.

    feedback on playlist management: if i unselect a playlist, i would want ti removed since it takes up space.

    feature request: can the playlist select list show playlists int eh same order as itunes. it seemed random to me.

    Again, very happy to have found a solution after a year of thinking i had to find a way to add bluetooth to my old ipod.

    thanks again.


    wouldnt the windows users benefit from the playlist structure? isnt that what this is really about? playlists? i had very few music files that couldnt be moved over because of format, but that it because msot of my library is not lossless.
     
  14. ny888

    ny888 Member

    Joined:
    Jan 30, 2015
    Messages:
    134
    Location:
    San Francisco, CA
    @majorlance - does this script preserve the order of the songs in each playlist?
     
  15. ra-san

    ra-san Member

    Joined:
    Dec 26, 2008
    Messages:
    296
    Location:
    San Diego, CA
    You don't need to (but can) have the Music folder if you are just using playlists. Can uncheck that top option altogether. I can see why someone would want to have a separate drive for playlists vs. the whole library since the S will go through all files on the drive, leading to showing duplicates (perhaps lots of copies of a song, if it's in the library plus multiple playlists) if you browse via the normal artists or songs type functionality.

    Thanks for the feedback. RE: playlist order - yeah, not sure what's going on with that. I build the tree in the same order Apple's iTunes framework code gives me the info.
    Prettying up that list, including fixing the ordering if possible and removing unexpected playlists generated behind the scenes by iTunes is on my todo list.

    Glad it's looking useful to you. Probably right about the playlist part - but would expect non iTunes playlists to be more important.
     
  16. ny888

    ny888 Member

    Joined:
    Jan 30, 2015
    Messages:
    134
    Location:
    San Francisco, CA
    Running majorlance's applescript for the first time.

    Created the Tesla playlist folder and 2 playlist within it. Only 8 songs total in my entire library just as a test. I'm getting this error after choosing destination folder:

    error "Can’t get item 1 of {}." number -1728 from item 1 of {}
     
  17. majorlance

    majorlance Member

    Joined:
    Sep 22, 2014
    Messages:
    204
    Location:
    Bethesda, MD
    ny888,

    Sounds like a timeout error. Or you may not be running Yosemite which my script requires for progress reporting (I did post an alternative in this thread for pre-Yosemite users). Regardless, ra-sans application (also detailed within this thread) is a more robust Objective C application that he's recently updated to include pseudo playlist capabilities (as my script did) by changing the genre to the playlist name. I've been out of town since the update but it sounds like a winner. You should try it and see if you still have errors.

    My initial goal was to automate a manual process that basically replicated syncing an iPod to iTunes within the limitations of the Tesla Media player (specifically it doesn't recognize playlists, go figure). The work-around was to change the genre to the playlist name.... instant playlist on the Tesla. The only downside to this approach is that you have multiple songs (one for each time it's in a playlist). My personal solution was to have another USB flash drive with just the songs in the "Tesla" playlist folder (I also wrote a script for this) that kept the genre and other song attributes intact... so you could play back by genre or artist, album, etc. Storage is cheap.

    So... try out ra-san's app. From what he's posted, I think it will meet both needs. My personal preference is that it syncs (adds and deletes) the flash drive like your iPhone or iPod does (hint to ra-san ;) but I'm just one user). An Objective C app vs. an Applescript (as I wrote) will be more robust- ultimately a better solution.

    Regardless, we're much closer to having a "sync and forget it" solution for the Tesla. :)

    Lee
    (majorlance)
     
  18. ny888

    ny888 Member

    Joined:
    Jan 30, 2015
    Messages:
    134
    Location:
    San Francisco, CA
    I ran sa-sans's app and it looks like it worked. It was only 2 playlist and 8 songs and took a long time. Could it be because it's writing to USB as well as my files are on a NAS drive?
     
  19. ra-san

    ra-san Member

    Joined:
    Dec 26, 2008
    Messages:
    296
    Location:
    San Diego, CA
    What's a long time, in rough terms? Did you look at the USB afterwards and see all the files there, and only the files you expected?

    For reference, when I run it on my library, which is on a NAS too, a few TB USB drive hanging off an Apple Time Capsule, and send it to my USB attached portable hard drive I use for the car, my scan rate for determining what to actually copy or convert is double digit tracks per second. The copy/convert rate is something like a song every half second to two seconds, depending on length and whether it is a copy or a conversion.

    I did use an old 4GB flash USB fob for testing the other night and noticed it was probably 10 times slower than the normal drive I use in the car, so the speed of the USB device can make major differences. My laptop was a mid 2010 MacBook Pro, and doesn't even have usb3, so I expect things are much faster on a newer machine with a fast usb3 fob or drive.
    If you aren't getting reasonable performance, try a known fast different USB drive to compare. If you see any errors or things that don't make sense, let me know.
     
  20. ny888

    ny888 Member

    Joined:
    Jan 30, 2015
    Messages:
    134
    Location:
    San Francisco, CA
    It took about 8 minutes. It might be the drive which is old or I just realized I plugged the drive into the keyboard port. I'll try again plugging in directly into the imac or a better flash drive . I did check that the files were on the drive.
     

Share This Page

  • About Us

    Formed in 2006, Tesla Motors Club (TMC) was the first independent online Tesla community. Today it remains the largest and most dynamic community of Tesla enthusiasts. Learn more.
  • Do you value your experience at TMC? Consider becoming a Supporting Member of Tesla Motors Club. As a thank you for your contribution, you'll get nearly no ads in the Community and Groups sections. Additional perks are available depending on the level of contribution. Please visit the Account Upgrades page for more details.


    SUPPORT TMC