Kodi Community Forum
[RELEASE] iTunes and iPhoto integration plugins for XBMC - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Music Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=148)
+---- Thread: [RELEASE] iTunes and iPhoto integration plugins for XBMC (/showthread.php?tid=37313)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26


- AlfredJKwack - 2011-01-18

nmirza Wrote:4- even thioughin my xbmc settings I've told it to play the next song, when I'm in a playlist and play a song, the next song does not play automatically.

After doing a little research I found out this is an XBMC bug. Auto-Advance should work automatically as of r35433.
Ref: http://forum.xbmc.org/showthread.php?tid=85692


- nmirza - 2011-01-18

Ok so did more testing and some of the isues seem resolved, i'll go by them one by one:

1-autoupdate. everything is fine for now even updating manually so this would be a great bonus if its there, but can live without it for now.

2-visualization: it doesnt work elsewhere either. so must be some xbmc issue. with the previoux xbmc before 10.0 itunes vis worked fine. ill do some research on this see what the problem is.

3-icons: if i replace them, and subsequently update the plugin, will it replace my icons? also, any plans to release this on add-on section of xbmc? that way autoupdates are taken care of.

4-album art. album art works in song list in playlist, but doesn't work in album view. would be nice to have a random album show up in the artist section for the artist, but i can understand why there are no icons there. for albums though i think should def have cover art, unlesss its a limitation of the xml file, then nothing that can be done about it. all my artwork though is embedded into the tags of the song. how do i scrape it from the songs?

5-colums/sorting. i don't think such a function for columns exists in xbmc. i have never seen any window, skin, plugin, etc that has columns. i hope im wrong, but i think this possibly wont work. i think the simpler thing to do would be to atleast just see if in the list view, whatever view you're in, album or song(playlist), if theres a way for the tag to be shows such that in album view its "Album - Artist" (right now its just album), and in the playlist view of songs, its "song - artist" (right now its just song). so without cover art in album view, and without artist name in playlists that might have hundreds of songs by different artists, you can see how it can be difficult identifying the song'album you want to play. hopefully this is easier to implement.

Just saw new post regarding xbmc bug. i'm using the newest xbmc public release build, i'll see what release that is and then upgrade to the newest svn you mentioned. also just saw auto update feature. awesome.

AlfredJKwack Wrote:Hi nmirza

Glad to see you're exited. As I'm not a developer I'm probably going to have to disappoint you. My skills extend to the ability to understand the structure of the code and the ability to interpret what some of the things are meant to do. I'm not in a position however to write code. All I've done is take a look at what was done for the iPhoto plugin and apply that to the iTunes plugin. It took a few hours of comparing files back and forth but it required no real coding experience.

Nevertheless here goes my feedback.



At the moment, yes. The iPhoto plugin has a neat "autoupdate" feature which I haven't implemented in the iTunes version - I didn't want to overextend myself first time around.

If anyone's a little adventurous, they're always welcome to submit a patch by taking example on what jingai's been doing with the iPhoto plugin.



There should be no link between the Visualization and the plugin. Does the visualization work in other circumstances (ie with other audio plugins)? Also, if you're able to reproduce it I'd appreciate a debug log (pastebin).



Feel free to replace the default png icons by your own. The path to the files (on a mac) is:
~/Library/Application Support/XBMC/addons/plugin.audio.itunes/resources/icons.



Does this behaviour occur when you're in the artist, album or other folders as well? Does the behavriour occur with other plugins as well? If not please let me know which ones you tested against and I'll try to take a look at it.



The source file from which the plugin works (ie. iTunes Music Library.xml) does not contain a path to the artwork.

I believe that iTunes stores the artwork in a proprietary format as well which makes it unlikely someone will write code to access it. The other possibilities to get the artwork are: scrape it from the internet or scraping it from the mp3 files themselves. In both these cases I believe the community would be better served if these were separate plugins that one could call and rely upon.



This should be feasible. I'll add it to the todo list.



Ideally for all of the above what you'd want is for XBMC to display a listing with a couple of colums (say: track, album, artist, rating) and have the columns be sortable. I don't have a good example on hand where this has been implemented. If you do, please let me know which plugin has this and I'll take a look.

I'm not a python developer remember. Perhaps someone more experienced can submit a patch to achieve these features.



- nmirza - 2011-01-18

Also, maybe you want to start a new thread for the itunes plugin release rather than adding it to the end here. it'll get mor exposure if its a new thread that mentions its a working new plugin.


- pecinko - 2011-01-18

nmirza Wrote:Also, maybe you want to start a new thread for the itunes plugin release rather than adding it to the end here. it'll get mor exposure if its a new thread that mentions its a working new plugin.

Please, don't do that. This is the right place.


iTunes plugin: album art, sorting & displayed info - AlfredJKwack - 2011-01-18

Hi,

nmirza Wrote:3-icons: if i replace them, and subsequently update the plugin, will it replace my icons? also, any plans to release this on add-on section of xbmc? that way autoupdates are taken care of.

Yes they will be replaced when the update is installed.

I think I'd like to see some further feedback from others before this plugin is released through the official XBMC addons repo.


nmirza Wrote:4-album art. album art works in song list in playlist, but doesn't work in album view. would be nice to have a random album show up in the artist section for the artist, but i can understand why there are no icons there. for albums though i think should def have cover art, unlesss its a limitation of the xml file, then nothing that can be done about it. all my artwork though is embedded into the tags of the song. how do i scrape it from the songs?

I've been giving this some thought myself but have yet to find a suitable solution.

I know that XBMC can get the artwork from the id3 tags of the files but I think that the files are not 'scraped' for this information when it's run through a plugin, at least not by default. I'm surprised you're even getting artwork to show up at all.

Using iTunes' own cover art is also a dead end. iTunes stores album art separately from the music files. The file path structure is obfuscated and the files containing the art are mpeg (itc) containers from which the art must be extracted. (see: http://www.cocoalab.com/?q=itunes_artwork and http://uneasysilence.com/archive/2007/07/11441/comment-page-1/#comment-393150).

If someone has an idea of how to go about it, I'm all ears.

If your files are properly tagged I'd wonder why you'd be using this plugin in the first place. Why not add the ~/Music/iTunes/iTunes Music (or wherever you files are actually stored) as a source to XBMC?
The only thing you'd be missing out on are your own ratings and playlists. There are solutions out there to get a 3mu playlist out of itunes. Once you have that you just drop them into the ~//Library/Application Support/XBMC/userdata/playlists/music folder.

nmirza Wrote:5-colums/sorting. i don't think such a function for columns exists in xbmc. i have never seen any window, skin, plugin, etc that has columns. i hope im wrong, but i think this possibly wont work. i think the simpler thing to do would be to atleast just see if in the list view, whatever view you're in, album or song(playlist), if theres a way for the tag to be shows such that in album view its "Album - Artist" (right now its just album), and in the playlist view of songs, its "song - artist" (right now its just song). so without cover art in album view, and without artist name in playlists that might have hundreds of songs by different artists, you can see how it can be difficult identifying the song'album you want to play. hopefully this is easier to implement.

I'm working on both the sorting issue and the display issue and will try to take into account your proposals. I do have a question: What would you expect to be displayed in an album list when an album has multiple artists (eg. a "Best of Rock Classics" album)

Btw. Could you tell me what skin you're using as well as the OS and iTunes version. This may be useful for a "tested on" statement.


- nmirza - 2011-01-18

I find the plugin solution alot more elegant and much much simpler than using directories to navigate. Also, the playlist system is indispensable I think. For example i have a downloads folder in itunes. It would be a pain trying to always export the playlist after the addition of songs. While i have added the directory for music in the music section, the way my library is structured is i have a separate full albums folder, which is easy to navigate in the non-plugin way. But i also have directories by 5-6 main genres, and downloads. But i usually play songs by playlist or album so it makes alot more sense to have my playlists in xbmc via a plugin.

albumart: if there is a best of album for example (i'm guessing you're referring to official cd releases rather than self made mixes) then the official album cover would be great to see. I use a program called tune-in which is added into itunes that gets coverart. i find it gets accurate coverart for such mixes. additionally, say someone only has 2-3 songs from a ebst of album, we should still see the official cover for that album.

my skin is rapier MikotoBuild.

AlfredJKwack Wrote:Hi,



Yes they will be replaced when the update is installed.

I think I'd like to see some further feedback from others before this plugin is released through the official XBMC addons repo.




I've been giving this some thought myself but have yet to find a suitable solution.

I know that XBMC can get the artwork from the id3 tags of the files but I think that the files are not 'scraped' for this information when it's run through a plugin, at least not by default. I'm surprised you're even getting artwork to show up at all.

Using iTunes' own cover art is also a dead end. iTunes stores album art separately from the music files. The file path structure is obfuscated and the files containing the art are mpeg (itc) containers from which the art must be extracted. (see: http://www.cocoalab.com/?q=itunes_artwork and http://uneasysilence.com/archive/2007/07/11441/comment-page-1/#comment-393150).

If someone has an idea of how to go about it, I'm all ears.

If your files are properly tagged I'd wonder why you'd be using this plugin in the first place. Why not add the ~/Music/iTunes/iTunes Music (or wherever you files are actually stored) as a source to XBMC?
The only thing you'd be missing out on are your own ratings and playlists. There are solutions out there to get a 3mu playlist out of itunes. Once you have that you just drop them into the ~//Library/Application Support/XBMC/userdata/playlists/music folder.



I'm working on both the sorting issue and the display issue and will try to take into account your proposals. I do have a question: What would you expect to be displayed in an album list when an album has multiple artists (eg. a "Best of Rock Classics" album)

Btw. Could you tell me what skin you're using as well as the OS and iTunes version. This may be useful for a "tested on" statement.



iTunes plugin v0.2.2 - AlfredJKwack - 2011-01-20

Hi,

The plugin's been updated:
- Added ability to sort songs by rating, genre, artist, album, track number.

Notes:
- Sort availability may be constrained the skin


- nmirza - 2011-01-22

Alfred, I just tried the plugin and have an issue with the sorting. I go into the top menu and by default everything is ssorted by genre, so it throws off the way the sorting was done in my itunes playlist originally. when i try to change it to for example date added, while it selects the item in menu, the sorting does not change, and when i go back into the sorting menu, it again says Genre, even though date, name etc has been selected.

A note on this sorting feature, i just realized that sorting by any way might throw off how one configured their playlist in itunes. for example, my downloads folder is sorted by as i download files, while i have some other playlists that are arranged in a certain way. can we have a defualt option, or something where we can revert back to the original itunes sort order. additionally, can you make it so that by default the plugin does not sort in any way and goes on itunes sorting, but then one can select to sort by genre, file name, etc.


AlfredJKwack Wrote:Hi,

The plugin's been updated:
- Added ability to sort songs by rating, genre, artist, album, track number.

Notes:
- Sort availability may be constrained the skin



- dallasnights - 2011-01-23

how do you make this plugin look at the itunes on my pc accross the network so I can see my itunes library and playlists on XBMC

Thank you


iTunes Plugin Updated (0.2.5) - AlfredJKwack - 2011-01-23

Hi,

The iTunes plugin has been updated once more.

It now provides some more information to your selected skin which should enable more views when looking at tracks and albums (check the confluence skin as a reference).

nmirza Wrote:Alfred, I just tried the plugin and have an issue with the sorting. I go into the top menu and by default everything is ssorted by genre,

The sorting has been fixed somewhat. The default sort should now be nothing/unsorted when viewing tracks. If you set it differently set it back to default/nothing/unsorted, go up a level, then back down it should give you what you expect.

dallasnights Wrote:how do you make this plugin look at the itunes on my pc accross the network so I can see my itunes library and playlists on XBMC

This feature has not been implemented yet. In order for this to work the following would need to happen.
  • the 'iTunes Music Library.xml' file needs to be accessible from within XBMC
  • the files themselves need to be accessible from the XBMC box
  • the paths to the files as stated in your 'iTunes Music Library.xml' file need to be rewritten so that they make sense for your XBMC box. (eg. from C:\myMusic\GreatArtist\Album\song.mp3 to SMB:\\myiTunesBox\MyShare\GreatArtist\Album\song.mp3 )

Watch this space... Or better yet, submit a patch at https://github.com/AlfredJKwack/plugin.audio.itunes/ here's a hint to get started: read pages 4 & 5


- jingai - 2011-01-25

AlfredJKwack Wrote:The sorting has been fixed somewhat. The default sort should now be nothing/unsorted when viewing tracks. If you set it differently set it back to default/nothing/unsorted, go up a level, then back down it should give you what you expect.

Hello, I haven't looked into what the issue is with your plugin (just haven't got the time right now to do much with this stuff), but is it possibly related to either of these two tickets:

http://trac.xbmc.org/ticket/10519
http://trac.xbmc.org/ticket/10505

Basically, I've found that if you don't let XBMC scan files for all information by itself, it will force you to scan everything yourself. Kind of annoying if all you want to do is, say, set the date on the file (which may or may not be the file's date, but rather perhaps the import date, date of the photo, etc)..

-jingai


- AlfredJKwack - 2011-01-25

jingai Wrote:... possibly related to either of these two tickets:

If I follow the logic correctly in ticket 10519, this would mean that adding items like so:

Code:
item.setInfo( type="music", infoLabels=labels )
        plugin.addDirectoryItem(handle = int(sys.argv[1]),
                                url=track['filename'],
                                listitem = item,
                                isFolder = False)

would prevent XBMC from leveraging any id3 tag information contained within the file being added.

Whereas adding an item without calling setInfo would allow XBMC to retrieve the information from the file.

I'll have to test this out a bit to see if XBMC scrapes the files, and somehow stores the information somewhere. Scraping the files every time would be a non-starter as far as I'm concerned due to performance... That being said, the only useful thing that's missing from my plugin at this point seems to be the artwork.

Now with regards to ticket 10505. This seems to be a lot like ticked 10252. Is this a duplicate?

Nice work on the iPhoto plugin btw. I'm still trying to understand how I could leverage the path substitution that you integrated so nicely.


- jingai - 2011-01-25

AlfredJKwack Wrote:If I follow the logic correctly in ticket 10519, this would mean that adding items like so:

Code:
item.setInfo( type="music", infoLabels=labels )
        plugin.addDirectoryItem(handle = int(sys.argv[1]),
                                url=track['filename'],
                                listitem = item,
                                isFolder = False)

would prevent XBMC from leveraging any id3 tag information contained within the file being added.

Whereas adding an item without calling setInfo would allow XBMC to retrieve the information from the file.

Correct. Which means you need to write (or find) a parser and include it in your plugin. In my case, that means a full EXIF/IPTC parser, which is not exactly lightweight, especially given one already exists in XBMC.

Quote:I'll have to test this out a bit to see if XBMC scrapes the files, and somehow stores the information somewhere.

It doesn't, if you set any information yourself.

Quote:Scraping the files every time would be a non-starter as far as I'm concerned due to performance...

I don't mean that it should. It should when reimporting the library, though (such as when something changes, like an album was added). Plus I believe it won't rescan a file unless it's changed, so it's not really slow or anything.

Quote:That being said, the only useful thing that's missing from my plugin at this point seems to be the artwork.

Album, artist, etc information isn't useful? You won't get any of that automatically because, I assume, you'd want to set the date as the date of the song/album release, not the modified date of the audio file. If you have XBMC scan the files, sorting by Date will be sorting by file date, not the release date of the song/album.

In my particular case, everything like the camera information, date taken, resolution, etc is not automatically scanned if all I want to do is set the date. The file date is rarely the date of the actual photograph, so I need to be able to set it by hand, but I can't without parsing the metadata myself.

Artwork you will not be able to get at because iTunes (stupidly) doesn't store the artwork in the file itself. Although, people can just add them in by hand with something like CoverScout. It's an extra step though. You may also be able to parse them out of the iTunes library, but again, if you set it by hand, you have to set everything by hand.

Quote:Now with regards to ticket 10505. This seems to be a lot like ticked 10252. Is this a duplicate?

It would appear so. I'll ask to have mine marked as such.. er, or not, you've already done that. Thanks Smile

Quote:Nice work on the iPhoto plugin btw. I'm still trying to understand how I could leverage the path substitution that you integrated so nicely.

Thanks. If you need any help, don't hesitate to contact me, either here or via email. I'm pretty busy at the moment but it can't hurt to ping me, in case it's something I can answer easily.

The path substitution stuff should be much the same though, no?

-jingai


- nmirza - 2011-01-25

just a point on the above post:

Sort by date: it makes more sense in itunes plugin to sort by file date (i.e. wehn you downloaded) rather than release of the song/album. i can see this making sense in iphoto plugin but i dont think it does in itunes.

additional info: along with cover art, i also think its important to have info on the artist/album. as it is right now, in any playlist, i can see the song name but not the artist which makes it difficult to identify songs.

auto play next song: i have installed the svn build from jan 2nd, which is above the build number you mentioned from the thread which should have had auto play next fixed. as of now, my playlist will still not auto play the next song. i made a post regarding this in the thread (http://forum.xbmc.org/showthread.php?tid=85692&page=2) and spiff said it works for him. maybe its a plugin setting?


- AlfredJKwack - 2011-01-25

jingai Wrote:It doesn't, if you set any information yourself.

I do set everything myself (see render_tracks()). The odd thing is, I also have album art showing up in some cases, which is something i don't set... That's is why I'm so confused.

I'll install a fresh release on another box and run a few test cases to isolate this a bit better as it appears we're experiencing very different issues.

jingai Wrote:The path substitution stuff should be much the same though, no?

Yes and no. In the case of iPhoto all the images are always stored at the same location as the xml file. With iTunes this can vary wildly.

Remember that the user can:
  • set the iTunes Media Folder as he chooses (network share, removable drive you name it).
  • choose not to have music copied into the iTunes Media Folder when adding music but have iTunes reference the files at their original location instead.
  • have internet based streams as content

This essentially means that for the path substitution to work I'll either have to choose a 'one size fits all' approach like the iPhoto solution or find some help and lots of time.

nmirza Wrote:Sort by date: it makes more sense in itunes plugin to sort by file date (i.e. wehn you downloaded) rather than release of the song/album.

I'd like to hear others chime in on this. There's a few dates in the source xml file which may be relevant and we can only pick one since there's only one corresponding infolabel.
  • Date added
  • Date modified
  • Date released

Also consider how many tracks in the iTunes library actually have this information (particularly the last one).

nmirza Wrote:additional info: along with cover art, i also think its important to have info on the artist/album. as it is right now, in any playlist, i can see the song name but not the artist which makes it difficult to identify songs.

That's odd.
  • Check that you're running the latest release (v0.2.5). If that's not the case you may have to rescan your database after upgrading.
  • To verify this is not a skin related issue, please switch over to the default skin (Confluence)
  • pull up a set of tracks from a playlist and set the view to "media info". You should see the artist, album, track number, year and track name in the left hand side.

As far as cover art is concerned there's little I can do. The iTunes art is simply not accessible as far as I can tell.

nmirza Wrote:auto play next song: i have installed the svn build from jan 2nd, which is above the build number you mentioned from the thread which should have had auto play next fixed. as of now, my playlist will still not auto play the next song. i made a post regarding this in the thread (http://forum.xbmc.org/showthread.php?tid=85692&page=2) and spiff said it works for him. maybe its a plugin setting?

Added to the list of things to look into...

-Alfred.