coverList.getThumb Worked, Now Crashes
Posted: Thu Sep 30, 2021 11:52 am
Hey, y'all. I'm working on a MediaMonkey plugin that allows me to write the currently playing music to a text file (and image file in the case of album artwork) in order to show up on my Twitch overlay. I intend on making this code OSS and sharing as a plugin with everyone
I've got some code that used to work until an unrelated crash, and now breaks every time I've tried to run since then.
I have the following code to get the album artwork:
```
player.getCurrentTrack().coverList.getValue(0).getThumb(100, 100)
```
(I'm in early stages of testing for this, in the final version I'd be doing checks to see `coverList.size` and doing `coverList.filterBySearchPhrase` to find `Front` of some kind before falling back to `0`)
This code worked perfectly fine for me on the debug build of MediaMonkey 5.0.2.2506 using Chrome's inspector until at some point (due to some unrelated bone-headed coding on my end) MediaMonkey crashed.
Ever since I've had to force close MediaMonkey, this code no longer functions as intended. Now when I run that code (on the same file), I get the following error:
```
Read lock not acquired! (D:\Delphi\MediaMonkeyClean\HTML5Monkey\BaseShared.pas, line 3898)
```
Two interesting things of note:
1) I don't have the `Delphi` folder on my `D:\` drive
2) This is a portable instance of MediaMonkey in `C:\\tools\MediaMonkey5Debug`, why is it reading from another drive?
This persists even on a clean installation of MediaMonkey5Debug (AKA just deleting the old portable folder, installing a new portable instance)
When I run:
```
player.getCurrentTrack().coverList.count
```
It's inconsistent with what it returns. Occasionally it returns `1` (which is correct for the file) or `0` (incorrect). However, even if it reads `1` this error still occurs
I've tested this code against the same file as before the crash (when it was still working) and on a different file. Issue persists regardless
I've sent a log using the built-in form and linked to this forum post URL as the text to find easier, but let me know if I can attach the log in a different way.
I'm currently stuck on developing this plugin until this is resolved
I've got some code that used to work until an unrelated crash, and now breaks every time I've tried to run since then.
I have the following code to get the album artwork:
```
player.getCurrentTrack().coverList.getValue(0).getThumb(100, 100)
```
(I'm in early stages of testing for this, in the final version I'd be doing checks to see `coverList.size` and doing `coverList.filterBySearchPhrase` to find `Front` of some kind before falling back to `0`)
This code worked perfectly fine for me on the debug build of MediaMonkey 5.0.2.2506 using Chrome's inspector until at some point (due to some unrelated bone-headed coding on my end) MediaMonkey crashed.
Ever since I've had to force close MediaMonkey, this code no longer functions as intended. Now when I run that code (on the same file), I get the following error:
```
Read lock not acquired! (D:\Delphi\MediaMonkeyClean\HTML5Monkey\BaseShared.pas, line 3898)
```
Two interesting things of note:
1) I don't have the `Delphi` folder on my `D:\` drive
2) This is a portable instance of MediaMonkey in `C:\\tools\MediaMonkey5Debug`, why is it reading from another drive?
This persists even on a clean installation of MediaMonkey5Debug (AKA just deleting the old portable folder, installing a new portable instance)
When I run:
```
player.getCurrentTrack().coverList.count
```
It's inconsistent with what it returns. Occasionally it returns `1` (which is correct for the file) or `0` (incorrect). However, even if it reads `1` this error still occurs
I've tested this code against the same file as before the crash (when it was still working) and on a different file. Issue persists regardless
I've sent a log using the built-in form and linked to this forum post URL as the text to find easier, but let me know if I can attach the log in a different way.
I'm currently stuck on developing this plugin until this is resolved