Compare commits

...

9 Commits

Author SHA1 Message Date
nunks 87920bb2c0 dockerfile buscando da branch modificada 2026-05-31 18:23:43 -03:00
nunks bf73f99907 Tentando conciliar as novidades com as minhas alteracoes 2026-05-31 17:46:32 -03:00
Ross Stewart e0b6be24c1 Bump version number
Documentation Generator / Build Sphinx documentation (push) Has been cancelled
2026-03-06 15:49:51 +00:00
Ross Stewart cd3575d514 Documentation update 2026-03-06 15:15:09 +00:00
rosskouk 77e8546baa Merge pull request #73 from rosskouk/feature-enhanced-debugging
Added enhanced debugging to ping() method
2026-03-06 15:14:33 +00:00
rosskouk 122d328de4 Merge pull request #66 from f-longobardi/main
Enable display of song metadata
Thanks to @f-longobardi
2026-03-06 15:13:01 +00:00
Ross Stewart f3846a2311 Added enhanced debugging to ping() method 2026-03-06 14:27:29 +00:00
Francesco 0cf1c52743 also for continued play 2025-10-25 16:31:15 +02:00
Francesco fcce6a8d11 add song metadata, respond to button requests in media player 2025-10-25 14:56:38 +02:00
6 changed files with 46 additions and 18 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ WORKDIR /opt
RUN pwd
RUN python3 -m venv env
RUN ls -la
RUN git clone https://g.nunks.org/nunks/asknavidrome-cafofo.git
RUN git clone -b nunks https://g.nunks.org/nunks/asknavidrome-cafofo.git
RUN ls -la asknavidrome-cafofo
WORKDIR /opt/asknavidrome-cafofo
RUN pwd
+3 -1
View File
@@ -3491,7 +3491,9 @@ embedded in the URI</p>
<span class="sig-name descname"><span class="pre">ping</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#asknavidrome.subsonic_api.SubsonicConnection.ping" title="Link to this definition">#</a></dt>
<dd><p>Ping a Subsonic API server</p>
<p>Verify the connection to a Subsonic compatible API server
is working</p>
is working. Enhanced logging has been added to examine the
HTTP response returned from the server to assist with troubleshooting
connection issues.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>True if the connection works, False if it does not</p>
+1 -1
View File
File diff suppressed because one or more lines are too long
+5 -3
View File
@@ -42,7 +42,7 @@ logger.addHandler(handler)
# Get service configuration
#
logger.info('AskNavidrome 0.9!')
logger.info('AskNavidrome 0.10!')
logger.debug('Getting configuration from the environment...')
try:
@@ -1004,7 +1004,8 @@ class NextPlaybackHandler(AbstractRequestHandler):
"""Handle NextIntent"""
def can_handle(self, handler_input: HandlerInput) -> bool:
return is_intent_name('AMAZON.NextIntent')(handler_input)
return (is_intent_name('AMAZON.NextIntent')(handler_input) or
is_request_type('PlaybackController.NextCommandIssued')(handler_input))
def handle(self, handler_input: HandlerInput) -> Response:
logger.debug('In NextPlaybackHandler')
@@ -1021,7 +1022,8 @@ class PreviousPlaybackHandler(AbstractRequestHandler):
"""Handle PreviousIntent"""
def can_handle(self, handler_input: HandlerInput) -> bool:
return is_intent_name('AMAZON.PreviousIntent')(handler_input)
return (is_intent_name('AMAZON.PreviousIntent')(handler_input) or
is_request_type('PlaybackController.PreviousCommandIssued')(handler_input))
def handle(self, handler_input: HandlerInput) -> Response:
logger.debug('In PreviousPlaybackHandler')
Regular → Executable
+15 -3
View File
@@ -42,7 +42,19 @@ def start_playback(mode: str, text: str, card_data: dict, track_details: Track,
:return: Amazon Alexa Response class
:rtype: Response
"""
metadata = AudioItemMetadata(
title=track_details.title,
subtitle=track_details.artist,
art=display.Image(
content_description=track_details.title,
sources=[
display.ImageInstance(
url='https://github.com/navidrome/navidrome/raw/master/resources/logo-192x192.png'
)
]
)
)
if mode == 'play':
# Starting playback
logger.debug('In start_playback() - play mode')
@@ -67,7 +79,7 @@ def start_playback(mode: str, text: str, card_data: dict, track_details: Track,
url=track_details.uri,
offset_in_milliseconds=track_details.offset,
expected_previous_token=None),
metadata=add_screen_background(card_data) if card_data else None
metadata=metadata
)
)
).set_should_end_session(True)
@@ -95,7 +107,7 @@ def start_playback(mode: str, text: str, card_data: dict, track_details: Track,
# if the Previous intent is used
offset_in_milliseconds=0,
expected_previous_token=track_details.previous_id),
metadata=None
metadata=metadata
)
)
).set_should_end_session(True)
+21 -9
View File
@@ -40,29 +40,41 @@ class SubsonicConnection:
self.api_version,
False)
self.logger.debug('Connected to Navidrome')
self.logger.debug('Connecting to Navidrome.....')
def ping(self) -> bool:
"""Ping a Subsonic API server
Verify the connection to a Subsonic compatible API server
is working
is working. Enhanced logging has been added to examine the
HTTP response returned from the server to assist with troubleshooting
connection issues.
:return: True if the connection works, False if it does not
:rtype: bool
"""
self.logger.debug('In function ping()')
status = self.conn.ping()
http_request = self.conn._getRequest('ping.view')
try:
http_request_result = self.conn._doInfoReq(http_request)
except Exception as e:
self.logger.error('Failed to connect to Navidrome: %s', e, exc_info=True)
return False
if status:
# Success
self.logger.debug('ping() response from server: %s', http_request_result)
status = http_request_result.get('status')
if status == 'ok':
self.logger.info('Successfully connected to Navidrome')
return True
elif status == 'failed':
err = http_request_result.get('error', {})
self.logger.error('Failed to connect to Navidrome: code=%s msg=%s',
err.get('code'), err.get('message'))
return False
else:
# Fail
self.logger.error('Failed to connect to Navidrome')
return self.conn.ping()
self.logger.error('Unexpected error when connecting to Navidrome: %r', status)
return False
def scrobble(self, track_id: str, time: int) -> None:
"""Scrobble the given track