Internet radio browser GUI for music/video streams from various directory services.

⌈⌋ ⎇ branch:  streamtuner2


Check-in [c854934751]

Overview
Comment:Remove contrib/bieber joke example.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c8549347511d38c07b2895303fe93fe3f14a0d00
User & Date: mario on 2015-05-01 22:52:25
Other Links: manifest | tags
Context
2015-05-01
22:53
Tag with priority:never, as it's not meant to be bundled really. check-in: 7df4f3284f user: mario tags: trunk
22:52
Remove contrib/bieber joke example. check-in: c854934751 user: mario tags: trunk
22:41
Separate statusbar timer-reset from text/progressbar setter. check-in: 3b7a4ff895 user: mario tags: trunk
Changes

Deleted contrib/bieber.py version [42bda022a3].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# api: streamtuner2
# title: Bieber
# description: Bieber music
# url: http://www.justinbiebermusic.com/
# version: 5.2
# type: channel
# category: example
# config: 
#     { "name": "bieber_filter", "type": "text", "value": "BIEBERBLAST", "description": "So and so." }
# priority: joke
#
# This was an entertaining test plugin for development. (Compound function
# went into the search feature, and the compound channel plugin obviously.)
#
# It's however a very simple plugin, and hence a good basis for writing
# your own extensions.


from channels import *


# Bieber music filter plugin
class bieber(ChannelPlugin):


    # config data
    config = [
    ]
    

    # category map
    categories = ['the Biebs']
    default = 'the Biebs'
    current = 'the Biebs'




    # static category list
    def update_categories(self):
        # nothing to do here
        pass


    # just runs over all channel plugins, and scans their streams{} for matching entries
    def update_streams(self, cat, force=0):

        # result list
        entries = []
        
        # kill our current list, so we won't find our own entries
        self.streams = {}
        
        # swamp through all plugins
        for name,p in self.parent.channels.iteritems():
            #print "bieberquest: channel", name

            # subcategories in plugins        
            for cat,stations in p.streams.iteritems():
                #print "   bq cat", cat
            
                # station entries
                for row in stations:

                    # collect text fields, do some typecasting, lowercasing
                    text = "|".join([str(e) for e in row.values()])
                    text = text.lower()

                    # compare
                    if text.find("bieb") >= 0:
                    
                        # add to result list
                        row["genre"] = name + ": " + row.get("genre", "")
                        entries.append(row)

        # return final rows list
        return entries
        


<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<