1
#Copyright (C) 2008 Erik Hetzner
3
#This file is part of Spydaap. Spydaap is free software: you can
4
#redistribute it and/or modify it under the terms of the GNU General
5
#Public License as published by the Free Software Foundation, either
6
#version 3 of the License, or (at your option) any later version.
8
#Spydaap is distributed in the hope that it will be useful, but
9
#WITHOUT ANY WARRANTY; without even the implied warranty of
10
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
#General Public License for more details.
13
#You should have received a copy of the GNU General Public License
14
#along with Spydaap. If not, see <http://www.gnu.org/licenses/>.
16
import re, spydaap, os, sys
17
from spydaap.daap import do
19
class MovParser(spydaap.parser.Parser):
20
file_re = re.compile(".*\\.[mV][oO][vV]$")
21
def understands(self, filename):
22
return self.file_re.match(filename)
24
def parse(self, filename):
26
statinfo = os.stat(filename)
27
d = [ do ('daap.songsize', os.path.getsize(filename)),
28
do ('daap.songdateadded', statinfo.st_mtime),
29
do ('daap.songdatemodified', statinfo.st_mtime),
30
do ('dmap.itemname', name),
31
do ('daap.songalbum', ''),
32
do ('daap.songartist', ''),
33
do ('daap.songbitrate', 0),
34
do ('daap.songcomment', ''),
35
do ('daap.songdescription', 'QuickTime movie file'),
36
do ('daap.songformat', 'mov'),
37
do ('com.apple.itunes.mediakind', 2),
38
do ('com.apple.itunes.has-video', True)