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

⌈⌋ ⎇ branch:  streamtuner2


Check-in [9a5cee5ac7]

Overview
Comment:Add `filter_bitrate` to default pack: list.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9a5cee5ac7be441253ffe5266fc738ae148c73bd
User & Date: mario on 2015-05-15 17:49:01
Other Links: manifest | tags
Context
2015-05-15
17:55
`timedout` and `description` are seemingly gone from the API responses. check-in: cbd84b656f user: mario tags: trunk
17:49
Add `filter_bitrate` to default pack: list. check-in: 9a5cee5ac7 user: mario tags: trunk
16:51
Add 0install requests dependency. check-in: 46e06de24a user: mario tags: trunk
Changes

Modified channels/__init__.py from [0b4e192682] to [13cd81f0c1].

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
# encoding: UTF-8
# api: streamtuner2
# type: class
# category: ui
# title: Channel plugins
# description: Base implementation for channels and feature plugins
# version: 1.5
# license: public domain
# author: mario
# url: http://fossil.include-once.org/streamtuner2/
# pack:
#    bookmarks.py, configwin.py, dirble.py, dnd.py, exportcat.py,
#    filtermusic.py, global_key.py, history.py, internet_radio.py,
#    itunes.py, jamendo.py, links.py, live365.py, modarchive.py,
#    myoggradio.py, pluginmanager2.py, radiobrowser.py, radionomy.py,
#    radiotray.py, search.py, shoutcast.py, somafm.py, streamedit.py,
#    surfmusik.py, timer.py, tunein.py, ubuntuusers.py,
#    useragentswitcher.py, xiph.py, youtube.py, favicon.py
# config: -
# priority: core
#
# GenericChannel implements the basic GUI functions and defines
# the default channel data structure. It implements fallback logic
# for all other channel implementations. Only `bookmarks` uses it
# directly.






|









|
|







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
# encoding: UTF-8
# api: streamtuner2
# type: class
# category: ui
# title: Channel plugins
# description: Base implementation for channels and feature plugins
# version: 1.6
# license: public domain
# author: mario
# url: http://fossil.include-once.org/streamtuner2/
# pack:
#    bookmarks.py, configwin.py, dirble.py, dnd.py, exportcat.py,
#    filtermusic.py, global_key.py, history.py, internet_radio.py,
#    itunes.py, jamendo.py, links.py, live365.py, modarchive.py,
#    myoggradio.py, pluginmanager2.py, radiobrowser.py, radionomy.py,
#    radiotray.py, search.py, shoutcast.py, somafm.py, streamedit.py,
#    surfmusik.py, timer.py, tunein.py, ubuntuusers.py, youtube.py,
#    useragentswitcher.py, xiph.py, favicon.py, filter_bitrate.py
# config: -
# priority: core
#
# GenericChannel implements the basic GUI functions and defines
# the default channel data structure. It implements fallback logic
# for all other channel implementations. Only `bookmarks` uses it
# directly.

Modified channels/filter_bitrate.py from [1de3cdcb14] to [1c1c85e7a0].

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

    meta = plugin_meta()
    module = "filter_bitrate"

    # Hijack postprocessing filters in stream_update handler 
    def __init__(self, parent):
        GenericChannel.postprocess_filters.append(self.filter_rows)
        print GenericChannel.postprocess_filters

    # Filter row on bitrate
    def filter_rows(self, row, channel):
        bits = int(row.get("bitrate", 0))
        if bits <= 10:
            return True
        elif row.get("format", channel.audioformat) in ("audio/ogg", "audio/aac", "audio/aacp"):
            return bits >= int(conf.min_bitrate_ogg)
        else:
            return bits >= int(conf.min_bitrate_mp3)








<











30
31
32
33
34
35
36

37
38
39
40
41
42
43
44
45
46
47

    meta = plugin_meta()
    module = "filter_bitrate"

    # Hijack postprocessing filters in stream_update handler 
    def __init__(self, parent):
        GenericChannel.postprocess_filters.append(self.filter_rows)


    # Filter row on bitrate
    def filter_rows(self, row, channel):
        bits = int(row.get("bitrate", 0))
        if bits <= 10:
            return True
        elif row.get("format", channel.audioformat) in ("audio/ogg", "audio/aac", "audio/aacp"):
            return bits >= int(conf.min_bitrate_ogg)
        else:
            return bits >= int(conf.min_bitrate_mp3)