add service rss url (can be copied to miniflux directly)

This commit is contained in:
Volker
2025-12-27 17:55:54 +01:00
parent 93eef59aa8
commit a11ec95e58
4 changed files with 12 additions and 5 deletions
+3
View File
@@ -14,6 +14,7 @@ CACHE_DIR = os.path.expandvars(os.environ.get('CACHE_DIR', '/var/mbz-rss-feeder/
MB_APP_NAME = os.path.expandvars(os.environ.get('MB_APP_NAME', 'mbz-rss-service'))
MB_VERSION = os.path.expandvars(os.environ.get('MB_VERSION', '1'))
MB_CONTACT = os.path.expandvars(os.environ.get('MB_CONTACT', 'someone@somewhere.com'))
MBZ_SERVICE_BASE_URL = os.path.expandvars(os.environ.get('MBZ_SERVICE_BASE_URL', 'http://mbz-rss-feeder:8080'))
# file system dir check
if not os.path.exists(CACHE_DIR):
@@ -41,6 +42,8 @@ class Config:
self.MB_APP_NAME = MB_APP_NAME
self.MB_VERSION = MB_VERSION
self.MB_CONTACT = MB_CONTACT
self.MBZ_SERVICE_BASE_URL = MBZ_SERVICE_BASE_URL
try:
with open(os.path.join(os.path.dirname(__file__), '..', 'VERSION')) as f:
self.VERSION = f.read().strip()
+4
View File
@@ -72,6 +72,10 @@ logger.info(f" - MusicBrainz Log Level: {mbz_log_level_str}")
musicbrainz.init_musicbrainz()
app = Flask(__name__)
@app.context_processor
def inject_service_name():
return {'service_base_url': config.MBZ_SERVICE_BASE_URL}
class ReverseProxied(object):
def __init__(self, app):
self.app = app
+4 -4
View File
@@ -109,7 +109,7 @@ def get_artist_relation_links(relationlist):
target = rel.get('target')
if not target:
continue
if re.match(r'^https://.*imdb\.com', target):
if re.match(r'^https://([^/]+\.)?imdb\.com', target):
links['IMDb'] = target
elif re.match(r'^https://music\.apple\.com', target):
links['apple'] = target
@@ -117,11 +117,11 @@ def get_artist_relation_links(relationlist):
links['amazon'] = target
elif re.match(r'^https://open\.spotify\.com', target):
links['spotify'] = target
elif re.match(r'^https://.*qobuz\.com', target):
elif re.match(r'^https://([^/]+\.)?qobuz\.com', target):
links['qobuz'] = target
elif re.match(r'^https://.*deezer\.com', target):
elif re.match(r'^https://([^/]+\.)?deezer\.com', target):
links['deezer'] = target
elif re.match(r'^https://.*beatport\.com', target):
elif re.match(r'^https://([^/]+\.)?beatport\.com', target):
links['beatport'] = target
return links
+1 -1
View File
@@ -11,7 +11,7 @@
({{ feed.artists|length }})
</div>
<div class="item-actions">
<a href="{{ url_for('get_feed_rss', feed_id=feed.id) }}">RSS</a>
<a href="{{ url_for('get_feed_rss', feed_id=feed.id) }}">RSS</a> | <a href="{{ service_base_url }}/feed/{{ feed.id }}">service rss</a>
<form class="form-inline" action="{{ url_for('delete_feed', feed_id=feed.id) }}" method="post">
<button type="submit">Delete</button>
</form>