Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--tracks doesn't export the same fields for csv/tsv as for json #13

Open
alundiak opened this issue Feb 26, 2017 · 2 comments
Open

--tracks doesn't export the same fields for csv/tsv as for json #13

alundiak opened this issue Feb 26, 2017 · 2 comments

Comments

@alundiak
Copy link
Contributor

alundiak commented Feb 26, 2017

I have many tracks, which exported to JSON file, and comparing csv/tsv files with json, I may state, that these fields are not exported to tsv/csv:

  • "Track Count"
  • "Composer"
  • "BPM"
  • "Disabled" (In JSON file, if track is disabled (unchecked in iTunes) the value is string = "". Yes, it's odd. And for tracks which are checked (enabled), field "Disabled" is not exported/appeared on JSON file)
  • "Comments"

@shawnbot was itunes-data designed to avoid/skip that field? Or it was not known at the development stage?

Anyway here is my data, based on node v7.5.0., npm v4.1.2. and itunes-data v0.1.3.

Command:

itunes-data --tracks data/tracks.json ~/Music/iTunes/iTunes\ Music\ Library.xml

Track Info Example in iTunes:
screen shot 2017-02-26 at 02 34 38

Here is cut from XML (from section "Tracks"):

<dict>
      <key>Track ID</key><integer>1584</integer>
      <key>Name</key><string>Europa</string>
      <key>Artist</key><string>Pryda</string>
      <key>Album Artist</key><string>Eric Prydz pres. Pryda</string>
      <key>Composer</key><string>Eric Prydz</string>
      <key>Album</key><string>Europa / Odyssey</string>
      <key>Grouping</key><string>PRYDA010 [Pryda Recordings]</string>
      <key>Work</key><string>PRY010</string>
      <key>Genre</key><string>House</string>
      <key>Kind</key><string>MPEG audio file</string>
      <key>Size</key><integer>19985090</integer>
      <key>Total Time</key><integer>495307</integer>
      <key>Track Number</key><integer>1</integer>
      <key>Track Count</key><integer>2</integer>
      <key>Year</key><integer>2007</integer>
      <key>Date Modified</key><date>2017-01-17T02:19:37Z</date>
      <key>Date Added</key><date>2015-12-23T19:34:05Z</date>
      <key>Bit Rate</key><integer>320</integer>
      <key>Sample Rate</key><integer>44100</integer>
      <key>Skip Count</key><integer>1</integer>
      <key>Skip Date</key><date>2017-01-16T23:27:04Z</date>
      <key>Artwork Count</key><integer>1</integer>
      <key>Sort Album Artist</key><string>Eric Prydz pres. Pryda</string>
      <key>Sort Composer</key><string>Eric Prydz</string>
      <key>Persistent ID</key><string>E7A174B7580D88CC</string>
      <key>Track Type</key><string>File</string>
      <key>Location</key><string>file:///Users/alund/Music/iTunes/iTunes%20Media/Music/Eric%20Prydz%20pres.%20Pryda/Europa%20_%20Odyssey/01%20Europa.mp3</string>
      <key>File Folder Count</key><integer>5</integer>
      <key>Library Folder Count</key><integer>1</integer>
</dict>

XML content s the same as truth:

<key>Composer</key><string>Eric Prydz</string>
<key>Name</key><string>Europa</string>
<key>Track Number</key><integer>1</integer>
<key>Track Count</key><integer>2</integer>

Europa is first track in album, and Odyssey is second. So total count is 2.

screen shot 2017-02-26 at 02 37 57

Here is JSON output:

{
    "Track ID": 1584,
    "Size": 19985090,
    "Total Time": 495307,
    "Track Number": 1,
    "Track Count": 2,
    "Year": 2007,
    "Date Modified": "2017-01-17T02:19:37.000Z",
    "Date Added": "2015-12-23T19:34:05.000Z",
    "Bit Rate": 320,
    "Sample Rate": 44100,
    "Skip Count": 1,
    "Skip Date": "2017-01-16T23:27:04.000Z",
    "Artwork Count": 1,
    "Persistent ID": "E7A174B7580D88CC",
    "Track Type": "File",
    "File Folder Count": 5,
    "Library Folder Count": 1,
    "Name": "Europa",
    "Artist": "Pryda",
    "Album Artist": "Eric Prydz pres. Pryda",
    "Composer": "Eric Prydz",
    "Album": "Europa / Odyssey",
    "Grouping": "PRYDA010 [Pryda Recordings]",
    "Genre": "House",
    "Kind": "MPEG audio file",
    "Sort Album Artist": "Eric Prydz pres. Pryda",
    "Sort Composer": "Eric Prydz",
    "Work": "PRY010",
    "Location": "file:///Users/alund/Music/iTunes/iTunes%20Media/Music/Eric%20Prydz%20pres.%20Pryda/Europa%20_%20Odyssey/01%20Europa.mp3"
}

Here is my CSV file header output:

Track ID,Size,Total Time,Year,Date Modified,Date Added,Bit Rate,Sample Rate,Play Count,Play Date,Play Date UTC,Skip Count,Skip Date,Artwork Count,Persistent ID,Track Type,File Folder Count,Library Folder Count,Name,Artist,Album,Grouping,Genre,Kind,Sort Album,Work,Location

Here is my TSV output:

Track ID	Size	Total Time	Year	Date Modified	Date Added	Bit Rate	Sample Rate	Play Count	Play Date	Play Date UTC	Skip Count	Skip Date	Artwork Count	Persistent ID	Track Type	File Folder Count	Library Folder Count	Name	Artist	Album	Grouping	Genre	Kind	Sort Album	Work	Location

BTW

This commands

itunes-data --artists artists.csv ~/Music/iTunes/iTunes\ Music\ Library.xml
itunes-data --artists artists.tsv ~/Music/iTunes/iTunes\ Music\ Library.xml

gives:

  • CSV file header:
Name,Track Count,Play Count
  • TSV file header:
Name	Track Count	Play Count

But this "Track Number" in scope of Artists (in fact as I see, --artists takes into consideration "Album Artist" field), is cumulative count of all Artist's tracks.

So I may say, that "Track Count" as a field is used by itunes-data for --tracks in wrong way (maybe not very proper).

@alundiak alundiak changed the title --tracks doesn't export "Track Count" for csv/tsv --tracks doesn't export "Track Count" and "Composer" for csv/tsv Feb 26, 2017
@alundiak alundiak changed the title --tracks doesn't export "Track Count" and "Composer" for csv/tsv --tracks doesn't export the same fields for csv/tsv as for json Feb 26, 2017
@alundiak
Copy link
Contributor Author

alundiak commented Sep 23, 2018

This time, I have iTunes v12.8, MacOS v10.13.6, node v10.11.0, npm v6.4.1.
I installed itunes-data@0.1.4 which still depends on fast-csv@0.4.4.
I also installed fast-csv@2.4.1 as @latest.

@shawnbot Issue still reproduced.

@shawnbot
Copy link
Owner

Hey @alundiak, thanks for reporting this. Unfortunately, I don't have much time to look at this library right now. If you're familiar and have some time to dig into it, I would be more than happy to make you a collaborator. 🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants