Check-in [a61a746c31]
Overview
| Comment: | Fix parent window references. |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
a61a746c31f0511227e05c64687eb1a1 |
| User & Date: | mario on 2015-04-10 10:51:18 |
| Other Links: | manifest | tags |
Context
|
2015-04-10
| ||
| 17:35 | Rewritten action module and playlist conversion/export works okay enough. Merged into trunk. check-in: 60f5238dc8 user: mario tags: trunk | |
| 10:54 | Sync with trunk changes. check-in: 801ad7fd98 user: mario tags: action-mapfmts | |
| 10:51 | Fix parent window references. check-in: a61a746c31 user: mario tags: trunk | |
| 10:50 | Removed custom pls conversion code, now uses action. playlist conversion tools. check-in: c683b52003 user: mario tags: trunk | |
Changes
Modified channels/bookmarks.py from [2e6c240bb2] to [3d2cb45781].
| ︙ | ︙ | |||
28 29 30 31 32 33 34 |
# layout. Which is why it derives from GenericChannel, and requires
# less setup.
#
# Furthermore it pretty much only handles a static streams{} list.
# Sub-plugins simply append a new category, and populate the streams
# list themselves.
#
| | | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# layout. Which is why it derives from GenericChannel, and requires
# less setup.
#
# Furthermore it pretty much only handles a static streams{} list.
# Sub-plugins simply append a new category, and populate the streams
# list themselves.
#
# It's accessible as `parent.bookmarks` in the ST2 window and elsewhere.
#
class bookmarks(GenericChannel):
# desc
module = "bookmarks"
title = "bookmarks"
base_url = "file:.config/streamtuner2/bookmarks.json"
|
| ︙ | ︙ | |||
105 106 107 108 109 110 111 |
def add(self, row):
# normalize data (this row originated in a gtk+ widget)
row["favourite"] = 1
if row.get("favicon"):
row["favicon"] = favicon.file(row.get("homepage"))
if not row.get("listformat"):
| | | 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
def add(self, row):
# normalize data (this row originated in a gtk+ widget)
row["favourite"] = 1
if row.get("favicon"):
row["favicon"] = favicon.file(row.get("homepage"))
if not row.get("listformat"):
row["listformat"] = self.parent.channel().listformat
# append to storage
self.streams["favourite"].append(row)
self.save()
self.load(self.default)
self.urls.append(row["url"])
|
| ︙ | ︙ | |||
154 155 156 157 158 159 160 |
# First we'll generate a list of current bookmark stream urls, and then
# remove all but those from the currently UPDATED_channel + category.
# This step is most likely redundant, but prevents accidently re-rewriting
# stations that are in two channels (=duplicates with different PLS urls).
check = {"http//": "[row]"}
check = dict((row.get("url", "http//"),row) for row in fav)
# walk through all channels/streams
| | | 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
# First we'll generate a list of current bookmark stream urls, and then
# remove all but those from the currently UPDATED_channel + category.
# This step is most likely redundant, but prevents accidently re-rewriting
# stations that are in two channels (=duplicates with different PLS urls).
check = {"http//": "[row]"}
check = dict((row.get("url", "http//"),row) for row in fav)
# walk through all channels/streams
for chname,channel in self.parent.channels.items():
for cat,streams in channel.streams.items():
# keep the potentially changed rows
if (chname == updated_channel) and (cat == updated_category):
freshened_streams = streams
# remove unchanged urls/rows
|
| ︙ | ︙ |