Initial Commit
[Projects.git] / pkgbuilds / pytivo / pkg / usr / share / pyTivo / plugins / music / templates / m3u.tmpl
bloba5e51a0d96bd0aacbaff66e7e3d2045620e81107
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/playlist</ContentType>
8 <SourceFormat>x-container/playlist</SourceFormat>
9 <TotalItems>$total</TotalItems>
10 </Details>
11 #for $file in $files
12 #if '://' in $file['path']
13 <Item>
14 <Details>
15 #if not 'Title' in $file
16 <Title>#echo $file['path'].strip() #</Title>
17 #end if
18 #if $file['is_playlist']
19 <ContentType>x-tivo-container/playlist</ContentType>
20 #else
21 <ContentType>audio/mpeg</ContentType>
22 #end if
23 #for $key in ('Title', 'Duration')
24 #if $key in $file and $file[$key]
25 <$key>$file[$key]</$key>
26 #end if
27 #end for
28 </Details>
29 <Links>
30 <Content>
31 #if $file['is_playlist']
32 <ContentType>x-tivo-container/playlist</ContentType>
33 <Url>/TiVoConnect?Command=QueryContainer&amp;Container=$quote($container)/$quote($file['path'].strip())</Url>
34 #else
35 <ContentType>audio/mpeg</ContentType>
36 <AcceptsParams>No</AcceptsParams>
37 <Url>$file['path'].strip()</Url>
38 #end if
39 </Content>
40 </Links>
41 </Item>
42 #elif $file['is_playlist']
43 <Item>
44 <Details>
45 <Title>#echo '.'.join(file['name'].split('.')[:-1]) #</Title>
46 <ContentType>x-tivo-container/playlist</ContentType>
47 </Details>
48 <Links>
49 <Content>
50 <ContentType>x-tivo-container/playlist</ContentType>
51 <Url>/TiVoConnect?Command=QueryContainer&amp;Container=$quote($container)$quote($file.part_path)</Url>
52 </Content>
53 </Links>
54 </Item>
55 #else
56 <Item>
57 <Details>
58 #if not 'Title' in $file
59 <Title>#echo '.'.join(file['name'].split('.')[:-1]) #</Title>
60 #end if
61 <ContentType>audio/mpeg</ContentType>
62 #for $key in ('Title', 'Duration', 'ArtistName', 'SongTitle', 'AlbumTitle', 'AlbumYear', 'MusicGenre')
63 #if $key in $file and $file[$key]
64 <$key>$file[$key]</$key>
65 #end if
66 #end for
67 </Details>
68 <Links>
69 <Content>
70 <ContentType>audio/mpeg</ContentType>
71 <AcceptsParams>$file.params</AcceptsParams>
72 <Url>/$quote($container)$quote($file.part_path)</Url>
73 </Content>
74 </Links>
75 </Item>
76 #end if
77 #end for
78 </TiVoContainer>