Check-in [6dfe1fdeb5]
Overview
| Comment: | Add overly crude playlist_convert.title() extraction (for M3U/PLS/XSPF/ASX and the custom STRING/TEXT format used by DND module). Insert imported rows at the right position. Scrolling won't work, because it's done in a separate thread. |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
6dfe1fdeb5c3aca6ceb0cfd5c4bc3550 |
| User & Date: | mario on 2015-04-20 23:18:26 |
| Other Links: | manifest | tags |
Context
|
2015-04-20
| ||
| 23:18 | Shorten "Ogg Vorbis 112kbit/s" option name (was expanding the general settings dialog too much). check-in: 8759215e26 user: mario tags: trunk | |
| 23:18 | Add overly crude playlist_convert.title() extraction (for M3U/PLS/XSPF/ASX and the custom STRING/TEXT format used by DND module). Insert imported rows at the right position. Scrolling won't work, because it's done in a separate thread. check-in: 6dfe1fdeb5 user: mario tags: trunk | |
| 16:24 | Move playlist extension and context probing into separate functions. Introduce some rather crude import functionality for a few playlist file formats. (Still requires proper importer with title= reading, and entirely rows[] based function signatures in action module.) check-in: 8e3b1e4d5b user: mario tags: trunk | |
Changes
Modified action.py from [ee9e1bcb9d] to [d87b406b97].
| ︙ | |||
324 325 326 327 328 329 330 | 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 | + + - + + + + + + + + + + + + + + |
urls = re.findall(rx, self.src, re.X)
# decode urls
if decode in ("xml", "*"):
urls = [xmlunescape(url) for url in urls]
if decode in ("json", "*"):
urls = [url.replace("\\/", "/") for url in urls]
# only uniques
uniq = []
urls = [uniq.append(u) for u in urls if not u in uniq]
|
| ︙ |
Modified channels/dnd.py from [9f80845729] to [ef4879a2ca].
1 2 | 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 | - - + + - + - + + | # encoding: UTF-8 # api: streamtuner2 |
| ︙ | |||
80 81 82 83 84 85 86 87 88 89 90 91 92 93 | 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | + + |
("text/uri-list", 0, 4),
# url+comments
("TEXT", 0, 5),
("STRING", 0, 5),
("UTF8_STRING", 0, 5),
("text/plain", 0, 5),
]
# Map target/`info` integers to action. module identifiers
cnv_types = {
20: "m3u",
21: "pls",
22: "xspf",
23: "smil",
25: "jspf",
15: "srv",
|
| ︙ | |||
135 136 137 138 139 140 141 142 | 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | + - + |
# Keep currently selected row when source dragging starts
def treelist_row(self):
cn = self.parent.channel()
row = copy.copy(cn.row())
row.setdefault("format", cn.audioformat)
row.setdefault("listformat", cn.listformat)
row.setdefault("url", row.get("homepage"))
row.update({"_origin": [cn.module, cn.current, cn.rowno()]}) # internal: origin channel+genre+rowid
return row
|
| ︙ | |||
208 209 210 211 212 213 214 | 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | - - + - - + + - + - + - + - + - + - + - + + + + + - + + + |
# incoming data
data = selection.get_text()
urls = selection.get_uris()
any = (data or urls) and True
# Convert/Add
|