Initial Commit
[Projects.git] / pkgbuilds / pytivo / pkg / usr / share / pyTivo / plugins / music / templates / container.tmpl
blobe8a705de81bfbb67edb1e04cebce4027be6555d6
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <TiVoContainer>
3 <ItemStart>$start</ItemStart>
4 <ItemCount>#echo len($files) #</ItemCount>
5 <Details>
6 <Title>$escape($name)</Title>
7 <ContentType>x-container/folder</ContentType>
8 <SourceFormat>x-container/folder</SourceFormat>
9 <TotalItems>$total</TotalItems>
10 </Details>
11 #for $file in $files
12 #if $file['is_dir']
13 <Item>
14 <Details>
15 <Title>$escape($file.name)</Title>
16 <ContentType>x-container/folder</ContentType>
17 </Details>
18 <Links>
19 <Content>
20 <ContentType>x-tivo-container/folder</ContentType>
21 <Url>/TiVoConnect?Command=QueryContainer&amp;Container=$quote($name)/$quote($file.name)</Url>
22 </Content>
23 </Links>
24 </Item>
25 #elif $file['is_playlist']
26 <Item>
27 <Details>
28 <Title>#echo '.'.join(file['name'].split('.')[:-1]) #</Title>
29 <ContentType>x-tivo-container/playlist</ContentType>
30 </Details>
31 <Links>
32 <Content>
33 <ContentType>x-tivo-container/playlist</ContentType>
34 <Url>/TiVoConnect?Command=QueryContainer&amp;Container=$quote($name)/$quote($file.name)</Url>
35 </Content>
36 </Links>
37 </Item>
38 #else
39 <Item>
40 <Details>
41 #if not 'Title' in $file
42 <Title>#echo '.'.join(file['name'].split('.')[:-1]) #</Title>
43 #end if
44 <ContentType>audio/mpeg</ContentType>
45 #for $key in ('Title', 'Duration', 'ArtistName', 'SongTitle', 'AlbumTitle', 'AlbumYear', 'MusicGenre')
46 #if $key in $file and $file[$key]
47 <$key>$file[$key]</$key>
48 #end if
49 #end for
50 </Details>
51 <Links>
52 <Content>
53 <ContentType>audio/mpeg</ContentType>
54 <AcceptsParams>$file.params</AcceptsParams>
55 <Url>/$quote($container)$quote($file.part_path)</Url>
56 </Content>
57 </Links>
58 </Item>
59 #end if
60 #end for
61 </TiVoContainer>