add service rss url (can be copied to miniflux directly)
This commit is contained in:
@@ -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_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_VERSION = os.path.expandvars(os.environ.get('MB_VERSION', '1'))
|
||||||
MB_CONTACT = os.path.expandvars(os.environ.get('MB_CONTACT', 'someone@somewhere.com'))
|
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
|
# file system dir check
|
||||||
if not os.path.exists(CACHE_DIR):
|
if not os.path.exists(CACHE_DIR):
|
||||||
@@ -41,6 +42,8 @@ class Config:
|
|||||||
self.MB_APP_NAME = MB_APP_NAME
|
self.MB_APP_NAME = MB_APP_NAME
|
||||||
self.MB_VERSION = MB_VERSION
|
self.MB_VERSION = MB_VERSION
|
||||||
self.MB_CONTACT = MB_CONTACT
|
self.MB_CONTACT = MB_CONTACT
|
||||||
|
self.MBZ_SERVICE_BASE_URL = MBZ_SERVICE_BASE_URL
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(os.path.join(os.path.dirname(__file__), '..', 'VERSION')) as f:
|
with open(os.path.join(os.path.dirname(__file__), '..', 'VERSION')) as f:
|
||||||
self.VERSION = f.read().strip()
|
self.VERSION = f.read().strip()
|
||||||
|
|||||||
@@ -72,6 +72,10 @@ logger.info(f" - MusicBrainz Log Level: {mbz_log_level_str}")
|
|||||||
musicbrainz.init_musicbrainz()
|
musicbrainz.init_musicbrainz()
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
@app.context_processor
|
||||||
|
def inject_service_name():
|
||||||
|
return {'service_base_url': config.MBZ_SERVICE_BASE_URL}
|
||||||
|
|
||||||
class ReverseProxied(object):
|
class ReverseProxied(object):
|
||||||
def __init__(self, app):
|
def __init__(self, app):
|
||||||
self.app = app
|
self.app = app
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ def get_artist_relation_links(relationlist):
|
|||||||
target = rel.get('target')
|
target = rel.get('target')
|
||||||
if not target:
|
if not target:
|
||||||
continue
|
continue
|
||||||
if re.match(r'^https://.*imdb\.com', target):
|
if re.match(r'^https://([^/]+\.)?imdb\.com', target):
|
||||||
links['IMDb'] = target
|
links['IMDb'] = target
|
||||||
elif re.match(r'^https://music\.apple\.com', target):
|
elif re.match(r'^https://music\.apple\.com', target):
|
||||||
links['apple'] = target
|
links['apple'] = target
|
||||||
@@ -117,11 +117,11 @@ def get_artist_relation_links(relationlist):
|
|||||||
links['amazon'] = target
|
links['amazon'] = target
|
||||||
elif re.match(r'^https://open\.spotify\.com', target):
|
elif re.match(r'^https://open\.spotify\.com', target):
|
||||||
links['spotify'] = target
|
links['spotify'] = target
|
||||||
elif re.match(r'^https://.*qobuz\.com', target):
|
elif re.match(r'^https://([^/]+\.)?qobuz\.com', target):
|
||||||
links['qobuz'] = target
|
links['qobuz'] = target
|
||||||
elif re.match(r'^https://.*deezer\.com', target):
|
elif re.match(r'^https://([^/]+\.)?deezer\.com', target):
|
||||||
links['deezer'] = target
|
links['deezer'] = target
|
||||||
elif re.match(r'^https://.*beatport\.com', target):
|
elif re.match(r'^https://([^/]+\.)?beatport\.com', target):
|
||||||
links['beatport'] = target
|
links['beatport'] = target
|
||||||
return links
|
return links
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
({{ feed.artists|length }})
|
({{ feed.artists|length }})
|
||||||
</div>
|
</div>
|
||||||
<div class="item-actions">
|
<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">
|
<form class="form-inline" action="{{ url_for('delete_feed', feed_id=feed.id) }}" method="post">
|
||||||
<button type="submit">Delete</button>
|
<button type="submit">Delete</button>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Reference in New Issue
Block a user