Changeset d6d01e737f2311e29a491f82bcbea6b9ed560928

Show
Ignore:
Timestamp:
11/18/07 14:27:46 (1 year ago)
Author:
Jason Michalski <armooo@armooo.net>
git-committer:
Jason Michalski <armooo@armooo.net> 1195417666 -0600
git-parent:

[def6912c4eaf2972ffc8193e25a3b02f96e968b0]

git-author:
Jason Michalski <armooo@armooo.net> 1195417666 -0600
Message:

Can have even more metadata

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/video/templates/container.tmpl

    r8218f71 rd6d01e7  
    3232            <SourceSize>$video.size</SourceSize> 
    3333                <Duration>$video.duration</Duration> 
    34         <Description>$video.description</Description> 
     34        <Description>$escape($video.description)</Description> 
     35        <EpisodeTitle>$escape($video.episode_title)</EpisodeTitle> 
     36        <SourceChannel>$escape($video.source_channel)</SourceChannel> 
     37        <SourceStation>$escape($video.source_station)</SourceStation> 
     38        <SeriesId>$video.series_id</SeriesId> 
    3539        </Details> 
    3640        <Links> 
  • plugins/video/video.py

    rdef6912 rd6d01e7  
    5757    def __metadata(self, full_path): 
    5858        description_file = full_path + '.txt' 
     59 
     60        metadata = { 
     61            'description' : '', 
     62            'episode_title' : '', 
     63            'source_channel' : '', 
     64            'source_station' : '', 
     65            'series_id' : '', 
     66        } 
     67 
    5968        if os.path.exists(description_file): 
    60             return open(description_file).read() 
    61         else: 
    62             return '' 
     69            for line in open(description_file): 
     70                if line.strip().startswith('#'): 
     71                    continue 
     72                if not ':' in line: 
     73                    continue 
     74 
     75                key, value = line.split(':', 1) 
     76                key = key.strip() 
     77                value = value.strip() 
     78 
     79                if key in metadata and not metadata[key]: 
     80                    metadata[key] = value 
     81 
     82        return metadata 
    6383 
    6484    def QueryContainer(self, handler, query): 
     
    92112                video['size'] = self.__est_size(full_path) 
    93113                video['duration'] = self.__duration(full_path) 
    94                 video['description'] = self.__description(full_path
     114                video.update(self.__metadata(full_path)
    95115 
    96116            videos.append(video)