maarten / Ximian

Generate an iTunes XML from your Swinsian (smart) playlists
MIT License
8 stars 1 forks source link

Swinsian Smart Playlist variable not available in iTunes #2

Open dashbad opened 7 years ago

dashbad commented 7 years ago

Love what you've done here.

I'm getting an error for Swinsian smart playlists that clearly use fields that aren't available for iTunes playlists. Not sure what is the best approach here - possibly ignore that particular variable, but still port over the rest of the smart playlist variables, or just exclude that smart playlist all together and throw a user message. Perhaps an option?

Example:

Swinsian playlist attached. screen shot 2017-05-29 at 6 40 37 pm

Error received:

Ximian[4455:15654912] SQLiteDB - failed to prepare SQL: SELECT title, artist, albumartist, album, grouping, genre, filesize, length, tracknumber, year, bpm, dateadded, bitrate, samplerate, comment, playcount, lastplayed, compilation, track_id, path FROM track WHERE fileType IS 'AIFF audio file' AND bitRate > 320, Error: no such column: fileType

FatCatLikesBeer commented 7 years ago

After taking a peak at the SQLite database structure, it seems like Swinsian doesn't have a column for "fileType" where Ximian expects to be one.

mhite commented 4 years ago

This is what happens when I run it:

Starting Ximian...
Swinsian DB Path: /Users/mhite/Library/Application Support/Swinsian/Library.sqlite
iTunes XML Path: /Users/mhite/Music/iTunes/iTunes Library.xml
iTunes Music Folder Path: /Users/mhite/Music/iTunes/iTunes Media
2020-05-02 18:38:41.094 Ximian[14048:12746765] SQLiteDB - failed to prepare SQL: SELECT title, artist, albumartist, album, grouping, genre, filesize, length, tracknumber, year, bpm, dateadded, bitrate, samplerate, comment, playcount, lastplayed, compilation, track_id, path FROM track WHERE fileType IS NOT 'MP3', Error: no such column: fileType
2020-05-02 18:38:41.230 Ximian[14048:12746765] SQLiteDB - failed to prepare SQL: SELECT title, artist, albumartist, album, grouping, genre, filesize, length, tracknumber, year, bpm, dateadded, bitrate, samplerate, comment, playcount, lastplayed, compilation, track_id, path FROM track WHERE fileType IS 'm4a', Error: no such column: fileType
2020-05-02 18:38:43.297 Ximian[14048:12746765] SQLiteDB - failed to prepare SQL: SELECT title, artist, albumartist, album, grouping, genre, filesize, length, tracknumber, year, bpm, dateadded, bitrate, samplerate, comment, playcount, lastplayed, compilation, track_id, path FROM track WHERE fileType IS 'AAC', Error: no such column: fileType
2020-05-02 18:38:44.813 Ximian[14048:12746765] SQLiteDB - failed to prepare SQL: SELECT title, artist, albumartist, album, grouping, genre, filesize, length, tracknumber, year, bpm, dateadded, bitrate, samplerate, comment, playcount, lastplayed, compilation, track_id, path FROM track WHERE fileType IS 'WAV', Error: no such column: fileType
2020-05-02 18:38:44.910 Ximian[14048:12746765] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -constantValue only defined for abstract class.  Define -[NSFunctionExpression constantValue]!'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff3560bacd __exceptionPreprocess + 256
    1   libobjc.A.dylib                     0x00007fff5fce8a17 objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff3560b8ff +[NSException raise:format:] + 201
    3   Foundation                          0x00007fff3797349e NSRequestConcreteImplementation + 220
    4   Foundation                          0x00007fff379162c1 -[NSExpression constantValue] + 39
    5   Ximian                              0x00000001010847ab _TFE6XimianCSo11NSPredicateP33_445845E0D8DD51A90D8888745EC19CD136SQLWhereClauseForComparisonPredicatefT9predicateCSo21NSComparisonPredicate_SS + 1307
    6   Ximian                              0x0000000101083c22 _TFE6XimianCSo11NSPredicateP33_445845E0D8DD51A90D8888745EC19CD126SQLWhereClauseForPredicatefT9predicateS0__SS + 242
    7   Ximian                              0x0000000101084121 _TFE6XimianCSo11NSPredicateP33_445845E0D8DD51A90D8888745EC19CD134SQLWhereClauseForCompoundPredicatefT9predicateCSo19NSCompoundPredicate_SS + 449
    8   Ximian                              0x0000000101083bae _TFE6XimianCSo11NSPredicateP33_445845E0D8DD51A90D8888745EC19CD126SQLWhereClauseForPredicatefT9predicateS0__SS + 126
    9   Ximian                              0x0000000101083b26 _TFE6XimianCSo11NSPredicate5toSQLfT_SS + 38
    10  Ximian                              0x0000000101083e7f _TToFE6XimianCSo11NSPredicate5toSQLfT_SS + 47
    11  Ximian                              0x0000000101069cea main + 32970
    12  libdyld.dylib                       0x00007fff614b73d5 start + 1
    13  ???                                 0x0000000000000002 0x0 + 2
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6

I think the error is related to this issue.