Re: multimedia columns in list view



Maybe I'm coming too late, but i wrote a nautilus extension that does
the same thing. It is only a draft, a test. It is written in python
and uses mutagen python module, so you need to have installed
python-nautilus (nautilus extensions python bindings) and
python-mutagen. After that just copy the script to
~/.nautilus/python-extensions, restart nautilus and you are done.

It is much less code (33 lines) and, i think, much less resources are
needed (over a 371 mp3 folder the time to get and display album,
artist and title is less than a second on a 2.2Ghz).


Giacomo Bordiga
import os
import urllib
import nautilus
from mutagen.easyid3 import EasyID3

class ColumnExtension(nautilus.ColumnProvider, nautilus.InfoProvider):
    def __init__(self):
        pass
    
    def get_columns(self):
        return (nautilus.Column("NautilusPython::title_column",
                               "title",
                               "Title",
                               "Song title"),
		nautilus.Column("NautilusPython::album_column",
                               "album",
                               "Album",
                               "Album"),
		nautilus.Column("NautilusPython::artist_column",
                               "artist",
                               "Artist",
                               "Artist"),)

    def update_file_info(self, file):
        if file.get_uri_scheme() != 'file':
            return
	if file.is_mime_type('audio/mpeg'):
	        filename = urllib.unquote(file.get_uri()[7:])
		audio = EasyID3(filename)
        	file.add_string_attribute('title', audio["title"][0])
        	file.add_string_attribute('album', audio["album"][0])
        	file.add_string_attribute('artist', audio["artist"][0])
		self.get_columns()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]