mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-09-04 17:16:50 +02:00
chore(logging): sanitize diagnostics and reduce noise
This commit is contained in:
@@ -1335,9 +1335,7 @@ class FFmpegService {
|
||||
localUrl,
|
||||
];
|
||||
|
||||
_log.d(
|
||||
'Starting live decrypt tunnel: ${_previewCommandForLog(commandArguments.join(' '))}',
|
||||
);
|
||||
_log.d('Starting live decrypt tunnel (format=$ext)');
|
||||
|
||||
final session = await FFmpegKit.executeWithArgumentsAsync(commandArguments);
|
||||
final isReady = await _awaitLiveTunnelReady(session);
|
||||
|
||||
@@ -329,7 +329,6 @@ class MusicPlayerHandler extends BaseAudioHandler
|
||||
(state == PlayerState.stopped ||
|
||||
state == PlayerState.completed ||
|
||||
state == PlayerState.disposed)) {
|
||||
_log.d('Ignoring transient $state event while switching tracks');
|
||||
return;
|
||||
}
|
||||
if (state == PlayerState.completed && _shouldIgnoreComplete) {
|
||||
@@ -1135,7 +1134,6 @@ class MusicPlayerHandler extends BaseAudioHandler
|
||||
_broadcastState(playerState: PlayerState.playing);
|
||||
_lastPeriodicPersistAt = DateTime.now();
|
||||
unawaited(_persistSession(position: effectiveStartPosition));
|
||||
_log.i('Playing: ${media.title}');
|
||||
// Some files do not emit onDurationChanged reliably (stuck at 0:00);
|
||||
// poll the engine for the real duration as a fallback.
|
||||
unawaited(_ensureDurationKnown(index, generation));
|
||||
@@ -1175,7 +1173,7 @@ class MusicPlayerHandler extends BaseAudioHandler
|
||||
return;
|
||||
}
|
||||
} catch (_) {
|
||||
// ignore and retry
|
||||
// Duration probing is best-effort; retry until the bounded loop ends.
|
||||
}
|
||||
await Future<void>.delayed(const Duration(milliseconds: 300));
|
||||
}
|
||||
@@ -1220,7 +1218,6 @@ class MusicPlayerHandler extends BaseAudioHandler
|
||||
|
||||
Future<void> _handlePlayerComplete() async {
|
||||
if (_shouldIgnoreComplete) {
|
||||
_log.d('Ignoring non-terminal player complete event');
|
||||
if (_userPaused || _interruptionActive) {
|
||||
_broadcastState(playerState: PlayerState.paused);
|
||||
}
|
||||
@@ -1273,7 +1270,6 @@ class MusicPlayerHandler extends BaseAudioHandler
|
||||
|
||||
@override
|
||||
Future<void> click([MediaButton button = MediaButton.media]) async {
|
||||
_log.d('Hardware media button: ${button.name}');
|
||||
switch (button) {
|
||||
case MediaButton.media:
|
||||
if (playbackState.value.playing) {
|
||||
@@ -1293,7 +1289,6 @@ class MusicPlayerHandler extends BaseAudioHandler
|
||||
|
||||
@override
|
||||
Future<void> pause() async {
|
||||
_log.i('Pausing internal player by user/control request');
|
||||
_playRequestGeneration++;
|
||||
_switchingGeneration = 0;
|
||||
_userPaused = true;
|
||||
@@ -1450,7 +1445,7 @@ class MusicPlayerHandler extends BaseAudioHandler
|
||||
kept.add(_media[i]);
|
||||
}
|
||||
|
||||
if (kept.length == _media.length) return; // nothing matched
|
||||
if (kept.length == _media.length) return;
|
||||
|
||||
_media
|
||||
..clear()
|
||||
|
||||
@@ -638,24 +638,11 @@ class PlatformBridge {
|
||||
useExtensions: useExtensions,
|
||||
useFallback: useFallback,
|
||||
);
|
||||
_log.i(
|
||||
'downloadByStrategy: "${payload.trackName}" by ${payload.artistName} '
|
||||
'(service: ${payload.service}, ext: ${routedPayload.useExtensions}, fallback: ${routedPayload.useFallback})',
|
||||
);
|
||||
final response = await _invokeDownloadMethod(
|
||||
'downloadByStrategy',
|
||||
routedPayload,
|
||||
);
|
||||
if (response['success'] == true) {
|
||||
final service = response['service'] ?? payload.service;
|
||||
final filePath = response['file_path'] ?? '';
|
||||
final bitDepth = response['actual_bit_depth'] as num?;
|
||||
final sampleRate = response['actual_sample_rate'] as num?;
|
||||
final qualityStr = bitDepth != null && sampleRate != null
|
||||
? ' ($bitDepth-bit/${(sampleRate / 1000).toStringAsFixed(1)}kHz)'
|
||||
: '';
|
||||
_log.i('Download success via $service$qualityStr: $filePath');
|
||||
} else {
|
||||
if (response['success'] != true) {
|
||||
final error = response['error'] ?? 'Unknown error';
|
||||
final errorType = response['error_type'] ?? '';
|
||||
_log.e('Download failed: $error (type: $errorType)');
|
||||
@@ -2057,7 +2044,6 @@ class PlatformBridge {
|
||||
}
|
||||
|
||||
static Future<void> setLibraryCoverCacheDir(String cacheDir) async {
|
||||
_log.i('setLibraryCoverCacheDir: $cacheDir');
|
||||
await _channel.invokeMethod('setLibraryCoverCacheDir', {
|
||||
'cache_dir': cacheDir,
|
||||
});
|
||||
@@ -2066,7 +2052,6 @@ class PlatformBridge {
|
||||
static Future<List<Map<String, dynamic>>> scanLibraryFolder(
|
||||
String folderPath,
|
||||
) async {
|
||||
_log.i('scanLibraryFolder: $folderPath');
|
||||
final result = await _channel.invokeMethod('scanLibraryFolder', {
|
||||
'folder_path': folderPath,
|
||||
});
|
||||
@@ -2088,9 +2073,6 @@ class PlatformBridge {
|
||||
String folderPath,
|
||||
Map<String, int> existingFiles,
|
||||
) async {
|
||||
_log.i(
|
||||
'scanLibraryFolderIncremental: $folderPath (${existingFiles.length} existing files)',
|
||||
);
|
||||
final result = await _channel.invokeMethod('scanLibraryFolderIncremental', {
|
||||
'folder_path': folderPath,
|
||||
'existing_files': jsonEncode(existingFiles),
|
||||
@@ -2116,7 +2098,6 @@ class PlatformBridge {
|
||||
}
|
||||
|
||||
static Future<List<Map<String, dynamic>>> scanSafTree(String treeUri) async {
|
||||
_log.i('scanSafTree: $treeUri');
|
||||
final result = await _channel.invokeMethod('scanSafTree', {
|
||||
'tree_uri': treeUri,
|
||||
});
|
||||
@@ -2188,9 +2169,6 @@ class PlatformBridge {
|
||||
String treeUri,
|
||||
Map<String, int> existingFiles,
|
||||
) async {
|
||||
_log.i(
|
||||
'scanSafTreeIncremental: $treeUri (${existingFiles.length} existing files)',
|
||||
);
|
||||
final result = await _channel.invokeMethod('scanSafTreeIncremental', {
|
||||
'tree_uri': treeUri,
|
||||
'existing_files': jsonEncode(existingFiles),
|
||||
|
||||
@@ -68,7 +68,7 @@ class ShareIntentService {
|
||||
for (final textToCheck in textsToCheck) {
|
||||
final url = _extractMusicUrl(textToCheck);
|
||||
if (url != null) {
|
||||
_log.i('Received music URL: $url (initial: $isInitial)');
|
||||
_log.i('Received supported music link (initial=$isInitial)');
|
||||
if (isInitial) {
|
||||
_pendingUrl = url;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user