Skip to content

Commit 1e382e7

Browse files
committed
- version 0.9.3.11.16
- fixing m3u->csv comma issues
1 parent d2d7390 commit 1e382e7

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

Changelog

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
2025-08-18 s-n-g
1+
2025-09-02 s-n-g
22
* version 0.9.3.11.16 - 0.9.3.12-beta16
33
* heavy refactoring - expect bugs!
44
* adding player field (optional) to station's definition

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "pyradio"
3-
version = "0.9.3.11.15"
3+
version = "0.9.3.11.16"
44
authors = [
55
{ name="Ben Dowling", email="[email protected]" },
66
{ name="Spiros Georgaras", email="[email protected]" },

pyradio/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
" pyradio -- Console radio player. "
33

4-
version_info = (0, 9, 3, 11, 15)
4+
version_info = (0, 9, 3, 11, 16)
55

66
# Set it to True if new stations have been
77
# added to the package's stations.csv

pyradio/install.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
''' This is PyRadio version this
1818
install.py was released for
1919
'''
20-
PyRadioInstallPyReleaseVersion = '0.9.3.11.15'
20+
PyRadioInstallPyReleaseVersion = '0.9.3.11.16'
2121

2222
locale.setlocale(locale.LC_ALL, "")
2323

pyradio/m3u.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
# "·" (MIDDLE DOT U+00B7)
4646
# "" (GREEK ANO TELEIA U+0387)
4747
M3U_SUBSTITUTIONS = (
48-
(",", " · "), # MIDDLE DOT (U+00B7) - BEST FOR CSV ROUND-TRIP
48+
(",", "_·_"), # MIDDLE DOT (U+00B7) - BEST FOR CSV ROUND-TRIP
4949
("-", "–"), # EN DASH (U+2013) WITH SPACES
5050
('"', "”"), # RIGHT DOUBLE QUOTATION MARK (U+201D)
5151
)
@@ -365,16 +365,16 @@ def parse_attributes(line):
365365
return out
366366

367367
def generate_reverse_subs():
368-
"""Creates reverse mappings with smart space handling"""
368+
"""
369+
Creates reverse mappings for M3U -> CSV round-trip.
370+
- Preserves "_·_" placeholders (protected commas) safely.
371+
- Converts normal substitutions back to their original form.
372+
"""
369373
reverse = {}
374+
370375
for orig, sub in reversed(M3U_SUBSTITUTIONS):
371-
if orig.endswith(' '): # Handle space-preserving substitutions
372-
reverse[sub] = orig
373-
else:
374-
reverse[sub] = orig
375-
# Special case: Ensure middle dot becomes comma+space
376-
if " · " in reverse:
377-
reverse[" · "] = ", "
376+
reverse[sub.replace("_·_", " · ")] = orig
377+
378378
return reverse
379379

380380
@functools.lru_cache(maxsize=1)
@@ -741,9 +741,9 @@ def list_to_m3u(stations, out_file):
741741
if logo:
742742
attrs.append(f'tvg-logo="{logo}"')
743743
if current_group:
744-
attrs.append(f'group-title="{current_group}"')
744+
attrs.append('group-title="{}"'.format(current_group.replace('_·_', ' · ')))
745745

746-
escaped_m3u_string = escape_m3u_string(name)
746+
escaped_m3u_string = escape_m3u_string(name).replace('_·_', ' · ')
747747
if attrs:
748748
joined_attrs = ' '.join(attrs)
749749
string = (f"#EXTINF:-1 {joined_attrs}, "

0 commit comments

Comments
 (0)