Giter VIP home page Giter VIP logo

eyetunes's Introduction

Hi there.

My website is at liquidx.net/. DM me on Twitter @liquidx.

eyetunes's People

Watchers

 avatar  avatar

eyetunes's Issues

Errors -1701 and -1712 while enumerating tracks and playlists

What steps will reproduce the problem?
1. Start iTunes 9.0.2
2. Invoke EyeTunes using [sharedInsance] method
3. Enumerate tracks and playlists using ETTrack and ETPlaylist methods

What is the expected output? What do you see instead?

I expect a smooth enumeration of elements with no errors spit out from the 
library.  Instead I get 
the following:
2010-01-06 12:12:38.951 MyApp[17349:a0f] Unable to find length of reply string: 
-1701
2010-01-06 12:12:38.954 MyApp[17349:a0f] Unable to find length of reply string: 
-1701
2010-01-06 12:12:39.482 MyApp[17349:a0f] Playist Library created with 1309 
tracks (0 tracks 
skipped)
2010-01-06 12:12:40.429 MyApp[17349:a0f] Playist Music created with 1309 tracks 
(0 tracks 
skipped)
2010-01-06 12:12:40.602 MyApp[17349:a0f] Playist Movies created with 0 tracks 
(0 tracks 
skipped)

and

2010-01-06 12:12:44.487 MyApp[17349:a0f] Playist 5-Star Rating created with 160 
tracks (0 
tracks skipped)
2010-01-06 12:14:44.515 MyApp[17349:a0f] Error sending Apple Event: -1712
2010-01-06 12:14:44.534 MyApp[17349:a0f] Playist 21st Century Music created 
with 41 tracks 
(0 tracks skipped)

What version of the product are you using? On what operating system?

I'm using version 1.3.3 on Mac OS X 10.6.2

Please provide any additional information below.

Here is the code that enumerates the EyeTunes resources and generates the 
errors.

- (BOOL)scanEyeTunesForApplicableTracks
{
    // start fresh; release any objects from a previous run
    [_trackStorage removeAllObjects];
    [_trackDictionary removeAllObjects];

    // Scan the user's root-playlist for all MP3 mand M4A tracks and add them to
    // our table-view.  These are the songs we consider to be elegible.
    EyeTunes* proxy = [EyeTunes sharedInstance];
    ETPlaylist* rootPlaylist = [proxy rootPlaylist];

    if ( rootPlaylist && rootPlaylist.trackCount > 0 )
    {
        for ( ETTrack* track in rootPlaylist.trackEnumerator )
        {
            if ( ([track.kind isEqualToString:@"AAC audio file"] ||
                  [track.kind isEqualToString:@"Purchased AAC audio file"] ||
                  [track.kind isEqualToString:@"MPEG audio file"]) &&
                ((track.bpm && NO == self.filterTracksWithBPMValues) ||
                 0 == track.bpm) &&
                !([track.genre isEqualToString:@"Books & Spoken"] ||
                  [track.genre isEqualToString:@"Classical"] ||
                  [track.genre isEqualToString:@"Podcast"]) )
            {
                CDAudioTrack* audioTrack = [CDAudioTrack audioTrackWithETTrack:track];
                [_trackStorage addObject:audioTrack];
                [_trackDictionary setObject:audioTrack forKey:track.persistentIdAsString];
                currentTrack = audioTrack;
                [self currentTrackHasChanged];
                MCLog(@"%@\nKind  : %@\nBPM   : %d\nGenre : %@\nID    : 0x%llX",
                      track.name, track.kind, track.bpm, track.genre, track.persistentId);
            }
        }

        return YES;
    }

    // call a standard alert function here
    MCLog(@"Unable to get root playlist");
    return NO;
}

- (id)initWithEyeTunes:(EyeTunes*)eyeTunes 
trackDictionary:(NSDictionary*)trackDictionary
{
    for ( ETPlaylist* etPlaylist in eyeTunes.playlistEnumerator )
    {
        CDPPlaylist* playlist = [[CDPPlaylist alloc] initWithETPlaylist:etPlaylist
                                                        trackDictionary:trackDictionary];

        if ( playlist.count )
        {
            rootNode = [[CDPNode alloc] initWithName:@"Root Node"];
            [rootNode.children addObject:playlist];
        }

        [playlist release];
    }

    return self;
}

- (id)initWithETPlaylist:(ETPlaylist*)playlist
         trackDictionary:(NSDictionary*)trackDictionary
{
    self = [super initWithName:playlist.name];

    if ( self )
    {
#ifndef DISTRIBUTION
        NSInteger skippedTracks = 0;
#endif
        for ( ETTrack* track in playlist.tracks )
        {
            CDAudioTrack* audioTrack = [trackDictionary objectForKey:track.persistentIdAsString];

            if ( audioTrack )
            {
                [children addObject:audioTrack];
            }
        }

        MCLog(@"Playist %@ created with %d tracks (%d tracks skipped)",
              _name,
              children.count,
              skippedTracks);
    }

    return self;
}

Original issue reported on code.google.com by [email protected] on 6 Jan 2010 at 5:22

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.