API extension for local scan?


#1

Hi,

I was looking for a Local Scan call in the API explorer, but it seems I can’t find. Am I missing something?


#2

I don’t have an API explorer instances running anywhere but I can see the call in the v1.1 documentation.
https://docs.mopidy.com/en/release-1.1/api/core/#mopidy.core.LibraryController.refresh

EDIT: Ignore this, I answered a different question for some reason.


#3

Sorry! I read that entirely wrong. But you can see from the API documentation that we don’t have any way to call “local scan” from the Core API. There’s a long-standing issue for this here which someone who was interested could work on solving.


#4

I will have a look at that link. In the meanwhile, isn’t just a matter of executing a system command from a python script, and call the python script through an AJAX call on the webclient?


#5

Yes, in terms of what PiMusicbox would do. But not in terms of what Mopidy would ideally do,


#6

Yes, I agree. But this could be an update of mopidy-musicbox-webclient


#7

I think I might be tempted to have it in mopidy-websettings. I wouldn’t expect it’s a button that would see much action and cluttering up the UI with that kind of thing is a slippery slope. FYI, this also applies to displaying the version information in musicbox-webclient. I’d probably prefer to have that on a dedicated debug page (along with the version information for everything and log files).


#8

Ok, but usually Home pages of web applications always have the version displayed. Maybe on the bottom of the page…


#9

At the bottom sounds nicer. That’s a lot less intrusive.


#10

Mmmh. At the bottom of the left column, as there is no footer in the webclient.


#11

I agree: the updateDB function should be in websettings, in the “Music files” section. But - as things are currently already mixed - I need to modify controls.js in mopidy-musicbox-webclient and __init__.py in mopidy-websettings. This is how things works now for reboot/shutdown.
(P.S: Why the reboot/shutdown functions are split between webclient and websettings??)


#12

This function can be easily implemented, but the code must be splitted over 2 separate projects, so it is quite uncommon and not standard. I think I’m going to edit my local files and not issue a Pull Request.


#13

I moved the version label at the bottom, see the Pull Request.

29