Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'I'm at 695 days' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
I'm at 695 days
Authored by: hamarkus on Oct 12, '07 09:33:57AM

And this probably does not include all the podcasts which get deleted after one listens to them.
I started using iTunes about eight years ago but at some point I started my library from scratch again, my oldest songs now are from Nov 2002. That means I should have listened to iTunes on average 9 hours per day. I am not sure this really correct.



[ Reply to This | # ]
I'm at 695 days
Authored by: Oops on Oct 12, '07 10:30:34AM
It does explicitly omit podcasts and video files from consideration.

If "Library Playlist 1" means the "Music" playlist, in which case audiobooks would not be included automatically, then audiobooks are omitted. If audiobooks are in library playlist 1, then the script does not remove audiobooks from consideration. I don't have any audiobooks and so I don't have a way to test this.

If anyone can tell me the answer to that question, or what sort of metadata is special to audiobooks (does the 'kind' contain audiobook?), then the script can easily be adapted to exclude audiobooks. The following should work if audiobooks do not reside in the 'Music' playlist automatically made by iTunes:

tell application "iTunes"
	set totalListeningTime to 0
	repeat with i from 1 to the count every track of playlist "Music"
		if (kind of track i of playlist "Music" contains "audio" and podcast of track i of playlist "Music" is false) then
			set timesPlayed to played count of track i of playlist "Music"
			set songLength to duration of track i of playlist "Music"
			set totalListeningTime to totalListeningTime + timesPlayed * songLength
		end if
	end repeat
	set totalHours to totalListeningTime / 3600
	set totalDays to totalHours / 24
	set totalYears to totalDays / 365.25
	display dialog "You have listened to " & totalDays & " days of music."
end tell
The only difference between this and the submitted script is that 'playlist "Music" ' is replaced by "library playlist 1". Looking at the script, I don't know how it can fail to give the correct answer. [The (kind of track i of playlist "Music" contains "audio" and podcast of track i of playlist "Music" is false) is to remove digital booklets and music videos from showing up. The podcast portion is unnecessary for the music playlist, but necessary if podcasts are in library playlist 1.]

Oops

[ Reply to This | # ]
I'm at 695 days
Authored by: Oops on Oct 12, '07 11:40:47AM

I have, on occasion, gone to class and left iTunes playing. If this happened enough, or overnight, or over the weekend, that could account for unusually high values. Other than this, or including audiobooks, or several iPods from different people syncing with iTunes, I don't know what would account for that high value. As you see from the code in my previous reply, it seems like it wouldn't be wrong.

Oops.



[ Reply to This | # ]
I'm at 695 days
Authored by: hamarkus on Oct 13, '07 05:48:12AM

My usual approach to a situation where the code does seem to be correct but the result not, is a brute force testing cycle.

Making several copies of my library, I would first cut it in half (in a random way, eg, alphabetically), then half it again and again until I am left with only a handful of songs. After verifying that the result is correct for these handful of songs, I would then run the script over all intermediate steps and plot the logarithm of the total playing time over the different slices of the library. I should then be able to fit a straight line to that. If there is significant sharp bend are jump in the data, then I would have found the part of the library that is giving suspicious results. Start again with this part to isolate the problem further.

I very much doubt however that I will go to that length.



[ Reply to This | # ]
I'm at 695 days
Authored by: Oops on Nov 12, '07 02:14:06PM
I have a new version at

http://oopsscripts.googlepages.com/

which will not count audio books if their genre is listed as "Books and Spoken". The old version did count audio books. Perhaps that was the issue it had with your library?

[ Reply to This | # ]
I'm at 695 days
Authored by: Oops on Sep 02, '08 09:37:37AM
I've had to put them on a new site:

http://sites.google.com/site/oopscripts/Home

as Google will be soon dropping 'Pages' in favor of 'Sites'. I think the scripts are fairly robust now.

[ Reply to This | # ]