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

⌈⌋ ⎇ branch:  streamtuner2


Check-in [5bc9e1a5f8]

Overview
Comment:Contrib plugin: show `extra` column in bookmarks (origin channel). Changed bookmark.add() to add it only if field missing.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5bc9e1a5f8c924daa84c36e23d7c3092ba495b70
User & Date: mario on 2016-11-01 16:03:40
Other Links: manifest | tags
Context
2016-11-01
21:57
Undo extra os.system("start \"%s\"") quotes for Windows. check-in: 2e49eacad9 user: mario tags: trunk
16:03
Contrib plugin: show `extra` column in bookmarks (origin channel). Changed bookmark.add() to add it only if field missing. check-in: 5bc9e1a5f8 user: mario tags: trunk
16:02
Reciva: added a more readable log.ERR() message for empty results. check-in: 66802cbdf6 user: mario tags: trunk
Changes

Modified channels/bookmarks.py from [d6be6027d1] to [767c735b6c].

101
102
103
104
105
106
107
108

109
110
111
112
113
114
115
101
102
103
104
105
106
107

108
109
110
111
112
113
114
115







-
+








        # Add / copy some row attributes
        row["favourite"] = 1
        if not row.get("favicon"):
            pass#   row["favicon"] = favicon.file(row.get("homepage"))
        if not row.get("listformat"):
            row["listformat"] = self.parent.channel().listformat
        if not row.get("extra"):
        if not len(row.get("extra", "")):
            row["extra"] = self.parent.channel().module

        # append to storage
        self.streams["favourite"].append(row)
        self.save()
        self.load(self.default)
        self.urls.append(row["url"])

Added contrib/bookmarks_show_extra.py version [47c6222785].












































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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
# encoding: utf-8
# api: streamtuner2
# title: UI: bookmarks: show `extra` field
# description: Extra field in bookmarks list
# version: 0.0
# type: feature
# category: ui
# config: -
# priority: rare
# 
# Just injects the `extra` column for display
#
##
# Now some of the workarounds (clean treeview) wouldn't be necessary if this
# was loaded prior to bookmarks plugin. But alas we don't have #order: loading
# support in ST2 init/pluginconf.
#

from config import *
import copy

# Inject into .bookmarks.datamap[]
class bookmarks_show_extra (object):
    plugin = "bookmarks_show_extra"
    meta = plugin_meta()

    def __init__(self, parent):
        bm = parent.bookmarks
        # clean treeview
        for c in bm.gtk_list.get_columns():
            bm.gtk_list.remove_column(c)
            c.destroy()
        # inject new column
        bm.datamap = copy.deepcopy(bm.datamap)
        bm.datamap.append(
            ["Extra", 40, ["extra", str, "text", {}] ]
        )
        # redraw treeview
        bm.columns([])
           # @bug: does not update existing {text:IDX} attribute for columns,
           # just happens to work for .append()