~ubuntu-branches/ubuntu/lucid/exaile/lucid

« back to all changes in this revision

Viewing changes to plugins/daapserver/spydaap/parser/mov.py

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Starr-Bochicchio
  • Date: 2010-02-12 19:51:01 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20100212195101-8jt3tculxcl92e6v
Tags: 0.3.1~b1-0ubuntu1
* New upstream release.
* Adjust exaile.install for new plugins.
* debian/control:
 - Drop unneeded python-dev Build-Dep.
 - Bump Standards-Version to 3.8.4 
* debian/rules: No empty po files to delete.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#Copyright (C) 2008 Erik Hetzner
 
2
 
 
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.
 
7
 
 
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.
 
12
 
 
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/>.
 
15
 
 
16
import re, spydaap, os, sys
 
17
from spydaap.daap import do
 
18
 
 
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)
 
23
    
 
24
    def parse(self, filename):
 
25
        name = 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)
 
39
              ]
 
40
        return (d, name)
 
41