Skip to content

Commit 048c60d

Browse files
committed
feat: --show-not-found option added
1 parent 94765a1 commit 048c60d

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ jobs:
1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@v4
15-
with:
16-
persist-credentials: false
1715

1816
- name: Setup Node.js
1917
uses: actions/setup-node@v4

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ All commands have these options available:
7777
* `--db <path>` : Navidrome SQLITE .db source file path. By default if not passed, will look for a file named `navidrome.db` in the same folder as `musicbee-navidrome-sync.exe`
7878
* `-u, --user <user_name>` : selects Navidrome username (by default if not used, the first found user will be used)
7979
* `--verbose` : verbose debugging
80+
* `--show-not-found` : output that were not found in Navidrome database (useful for troubleshooting missing tracks without verbose output noise)
8081
* `-h, --help` : displays help for command
8182

8283

@@ -89,6 +90,7 @@ All commands have these options available:
8990
* For tracks: if MusicBee rating is greater than Navidrome rating
9091
* For albums, if more than half of the album tracks are rated (its rating will be the average of available tracks ratings)
9192
* For artists, same as album, will be applied only to artists with more than 1 track
93+
* **Cross-version compatibility**: Automatically detects and works with both old and new Navidrome database schemas
9294
* Tested with the following versions :
9395
* MusicBee:
9496
* 3.5.*

index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ const commandLinesOptions = {
3030
verbose: {
3131
flags: '--verbose',
3232
description: 'verbose debugging'
33+
},
34+
showNotFound: {
35+
flags: '--show-not-found',
36+
description: 'output tracks that were not found in Navidrome database'
3337
}
3438
};
3539

@@ -46,6 +50,7 @@ program
4650
.option(commandLinesOptions.user.flags, commandLinesOptions.user.description)
4751
.option('-f, --first', 'run sync for the first time: add MB playcount to ND playcount')
4852
.option(commandLinesOptions.verbose.flags, commandLinesOptions.verbose.description)
53+
.option(commandLinesOptions.showNotFound.flags, commandLinesOptions.showNotFound.description)
4954
.option(commandLinesOptions.csv.flags, commandLinesOptions.description, commandLinesOptions.defaultValue)
5055
.option(commandLinesOptions.db.flags, commandLinesOptions.db.description, commandLinesOptions.db.defaultValue)
5156
.option(

lib/handlers/MBNDSynchronizer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,8 @@ class MBNDSynchronizer {
304304

305305
if (!foundTrack) {
306306
notFoundTracksCount++;
307-
if (options.verbose) {
308-
console.error(`track not found: ${track.filename} in${track.filePath}`);
307+
if (options.verbose || options.showNotFound) {
308+
console.error(`track not found: ${track.filename} in ${track.filePath}`);
309309
}
310310
return;
311311
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"commander": "^14.0.0",
1919
"csvtojson": "^2.0.10",
2020
"dayjs": "^1.11.13",
21-
"p-limit": "^7.1.0",
21+
"p-limit": "^3.1.0",
2222
"sequelize": "^6.37.7",
2323
"sqlite3": "^5.1.7"
2424
},

0 commit comments

Comments
 (0)