beetbox / beetbox/beets

In duplicate detection output, detect and report missing files instead of logging errors

Open
#2,485 3 comments 1 reaction 0 assignees View on GitHub
feature
Dominant language
Python
Stars
15.7k
Forks
2.1k
Avg merge
4d 21h
Merged PRs (30d)
31

Description

### Problem

If the beets importer finds >=2 duplicate albums in the library, and the second one has vanished from the file system, it hides that the first one is still substantial.

```
This album is already in the library!
Old: 16 items, FLAC, 646kbps, 72:40, 347.2 MiB
could not get filesize: [WinError 2] The system cannot find the file specified: '\\\\?\\e:\\test\\Bill_Evans_Trio\\test\\Bill Evans - Compilation - 1987 - 02. The Complete Riverside Recordings (1991 CD) [675]\\02-01. Tenderly.flac'
could not get filesize: [WinError 2] The system cannot find the file specified: '\\\\?\\e:\\test\\Bill_Evans_Trio\\test\\Bill Evans - Compilation - 1987 - 02. The Complete Riverside Recordings (1991 CD) [675]\\02-02. What Is There to Say?.flac'
could not get filesize: [WinError 2] The system cannot find the file specified: '\\\\?\\e:\\test\\Bill_Evans_Trio\\test\\Bill Evans - Compilation - 1987 - 02. The Complete Riverside Recordings (1991 CD) [675]\\02-03. Peace Piece.flac'
could not get filesize: [WinError 2] The system cannot find the file specified: '\\\\?\\e:\\test\\Bill_Evans_Trio\\test\\Bill Evans - Compilation - 1987 - 02. The Complete Riverside Recordings (1991 CD) [675]\\02-04. Lucky to Be Me.flac'
could not get filesize: [WinError 2] The system cannot find the file specified: '\\\\?\\e:\\test\\Bill_Evans_Trio\\test\\Bill Evans - Compilation - 1987 - 02. The Complete Riverside Recordings (1991 CD) [675]\\02-05. Some Other Time.flac'
could not get filesize: [WinError 2] The system cannot find the file specified: '\\\\?\\e:\\test\\Bill_Evans_Trio\\test\\Bill Evans - Compilation - 1987 - 02. The Complete Riverside Recordings (1991 CD) [675]\\02-06. Epilogue.flac'
could not get filesize: [WinError 2] The system cannot find the file specified: '\\\\?\\e:\\test\\Bill_Evans_Trio\\test\\Bill Evans - Compilation - 1987 - 02. The Complete Riverside Recordings (1991 CD) [675]\\02-07. You and the Night and the Music.flac'
could not get filesize: [WinError 2] The system cannot find the file specified: '\\\\?\\e:\\test\\Bill_Evans_Trio\\test\\Bill Evans - Compilation - 1987 - 02. The Complete Riverside Recordings (1991 CD) [675]\\02-08. How Am I to Know?.flac'
could not get filesize: [WinError 2] The system cannot find the file specified: "\\\\?\\e:\\test\\Bill_Evans_Trio\\test\\Bill Evans - Compilation - 1987 - 02. The Complete Riverside Recordings (1991 CD) [675]\\02-09. Woody'n You (take 1).flac"
could not get filesize: [WinError 2] The system cannot find the file specified: "\\\\?\\e:\\test\\Bill_Evans_Trio\\test\\Bill Evans - Compilation - 1987 - 02. The Complete Riverside Recordings (1991 CD) [675]\\02-10. Woody'n You (take 2).flac"
could not get filesize: [WinError 2] The system cannot find the file specified: '\\\\?\\e:\\test\\Bill_Evans_Trio\\test\\Bill Evans - Compilation - 1987 - 02. The Complete Riverside Recordings (1991 CD) [675]\\02-11. My Heart Stood Still.flac'
could not get filesize: [WinError 2] The system cannot find the file specified: '\\\\?\\e:\\test\\Bill_Evans_Trio\\test\\Bill Evans - Compilation - 1987 - 02. The Complete Riverside Recordings (1991 CD) [675]\\02-12. Green Dolphin Street.flac'
could not get filesize: [WinError 2] The system cannot find the file specified: "\\\\?\\e:\\test\\Bill_Evans_Trio\\test\\Bill Evans - Compilation - 1987 - 02. The Complete Riverside Recordings (1991 CD) [675]\\02-13. Peri's Scope.flac"
could not get filesize: [WinError 2] The system cannot find the file specified: '\\\\?\\e:\\test\\Bill_Evans_Trio\\test\\Bill Evans - Compilation - 1987 - 02. The Complete Riverside Recordings (1991 CD) [675]\\02-14. Witchcraft.flac'
Old: 14 items, FLAC, 593kbps, 69:23, 0.0 B
New: 131 items, FLAC, 678kbps, 744:58, 3.6 GiB
[S]kip new, Keep both, Remove old? r
```

In the above log I said remove old because it looked like there was only one 0 byte album to remove. There were too many irrelevant messages.

Suggested fixes:

* color-code individual "This album is already in the library!" messages differently from "could not get filesize" message
* find which files are missing, then report them all to the user after separately reporting all the intact files

### Setup

* OS: Win10
* Python version: 3.6.0
* beets version: 1.4.3
* plugins: copyartifactspy3, fetchart, inline, the
* Turning off plugins made problem go away (yes/no): unknown

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.