- Added scrobbling functionality, tracks will now be scrobbled if you have enabled the feature on your Navidrome instance
- Resolves #52 - Resolves #33
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from datetime import datetime
|
||||
from flask import Flask, render_template
|
||||
import logging
|
||||
from multiprocessing import Process
|
||||
@@ -845,6 +846,11 @@ class PlaybackFinishedHandler(AbstractRequestHandler):
|
||||
|
||||
def handle(self, handler_input: HandlerInput) -> Response:
|
||||
logger.debug('In PlaybackFinishedHandler')
|
||||
|
||||
# Generate a timestamp in milliseconds for scrobbling
|
||||
timestamp_ms = datetime.now().timestamp()
|
||||
current_track = play_queue.get_current_track()
|
||||
connection.scrobble(current_track.id, timestamp_ms)
|
||||
play_queue.get_next_track()
|
||||
|
||||
return handler_input.response_builder.response
|
||||
|
||||
Reference in New Issue
Block a user