Tiempo total de reproducción de iTunes por artista

1

¿Hay una manera fácil de extraer metadatos de iTunes? Quiero saber cuánto se ha reproducido un determinado artista (para cada pista, playcount * duración de la pista).

    
pregunta Thalecress 11.08.2012 - 03:03

2 respuestas

2

Puedes hacerlo con AppleScript (suponiendo que estés en una Mac). Aquí hay un poco de código desquiciado que he golpeado juntos. Abra el editor de AppleScript, péguelo y ejecútelo.

set dialog_reply to display dialog "Enter artist name:" default answer "Boards Of Canada"

if text returned of dialog_reply is not "" then
    set plays_list to {}
    set times_list to {}
    set artist_name to text returned of dialog_reply
    tell application "iTunes"
        try
            tell source 1
                tell library playlist 1
                    tell (every track whose artist is artist_name)
                        set plays_list to played count
                        set times_list to time
                    end tell
                end tell
            end tell
        on error
            display alert "Couldn't find anything by " & artist_name as warning
        end try
    end tell

    if length of plays_list is greater than 0 then
        set total_time_minutes to 0
        set total_time_seconds to 0
        repeat with i from 1 to (length of times_list)
            set this_time to (item i of times_list)
            set text item delimiters to ":"
            set time_elements to every text item of this_time
            set this_minutes to item 1 of time_elements
            set this_seconds to item 2 of time_elements
            if item i of plays_list is greater than 0 then
                set total_time_minutes to total_time_minutes + (this_minutes)
                set total_time_seconds to total_time_seconds + (this_seconds)
            end if
        end repeat

        set total_time_minutes to total_time_minutes + (total_time_seconds div 60)
        set total_time_seconds to (total_time_seconds mod 60)

        if total_time_minutes is greater than 0 or total_time_seconds is greater than 0 then
            if length of (total_time_seconds as string) is less than 2 then set total_time_seconds to "0" & total_time_seconds as string
            display alert "You've played " & artist_name & " for " & total_time_minutes & "m " & total_time_seconds & "s." as informational
        else
            display alert "Looks like you haven't played anything by " & artist_name & " yet?" as warning
        end if

    end if
end if
    
respondido por el user26787 12.08.2012 - 14:06
2

Hay una aplicación en la Mac App Store llamada mySpins que te ofrece todo tipo de información como esa: conteos de juegos, tiempo total de juego, etc.

    
respondido por el Kirk McElhearn 20.08.2012 - 09:23

Lea otras preguntas en las etiquetas