[Script] Script to rescan MediaFolders

Scripts for Madsonic
User avatar
Madsonic
Administrator
Administrator
Posts: 984
Joined: 07 Dec 2012, 03:58
Answers: 7
Has thanked: 1201 times
Been thanked: 470 times

[Script] Script to rescan MediaFolders

Unread post by Madsonic »

Hi,

some People want to trigger this more often as you can set in Madsonic.

i write a short windows script to trigger this action.

i used a special wget version which can handle self signed certificates if you use SSL.

Code: Select all

:::::::::::::::::::::
:: Rescan Madsonic ::
:::::::::::::::::::::

:: rescan Subsonic MediaFolders
:: edit username/password/serverlink to your need

set username=admin
set password=admin
set serverlink=http://127.0.0.1

:::::::::::::::::::::

set wgetsettings=--spider --no-check-certificate --cookies=on --keep-session-cookies --save-cookies=%temp%\cookie.txt

wget %wgetsettings% --user-agent=Mozilla "%serverlink%/login.view?user=%username%&password=%password%" 
wget %wgetsettings% --load-cookies=%temp%\cookie.txt --referer="%serverlink%" "%serverlink%/musicFolderSettings.view?scanNow" 
best regards
Attachments
rescan-script.zip
(1.71 MiB) Downloaded 706 times
These users thanked the author Madsonic for the post:
admin
Rating: 7.69%
boognish43
Posts: 1
Joined: 22 Jan 2013, 15:31
Has thanked: 0
Been thanked: 1 time

Re: [Script] WGET Script to rescan MediaFolders

Unread post by boognish43 »

First post.. great job with madsonic!!

I went back to 4.6 after trying 4.7 since I wasnt able to see my media right when it was added.
I am playing around with Madsonic which looks incredible!!!! I see that when I add a new album i still need to refresh on the browser version before I can see it in the mobile app. I believe this script will solve this solution for me..is this correct?
Thanks for all your hard work!
These users thanked the author boognish43 for the post:
Madsonic
Rating: 7.69%
User avatar
Madsonic
Administrator
Administrator
Posts: 984
Joined: 07 Dec 2012, 03:58
Answers: 7
Has thanked: 1201 times
Been thanked: 470 times

Re: [Script] WGET Script to rescan MediaFolders

Unread post by Madsonic »

boognish43 wrote:First post.. great job with madsonic!!

I went back to 4.6 after trying 4.7 since I wasnt able to see my media right when it was added.
I am playing around with Madsonic which looks incredible!!!! I see that when I add a new album i still need to refresh on the browser version before I can see it in the mobile app. I believe this script will solve this solution for me..is this correct?
Thanks for all your hard work!
Since Build 3336 you can use instead the NEW REST APIs: startRescan, scanstatus

EXAMPLE:

Code: Select all

http://localhost:4040/rest/startRescan.view?u=admin&p=admin&v=1.9.0&c=WebScript

http://localhost:4040/rest/scanstatus.view?u=admin&p=admin&v=1.9.0&c=WebScript
RESULT:

Code: Select all

<subsonic-response xmlns="http://subsonic.org/restapi" status="ok" version="1.9.0">
<Scan>
<Status started="true" count="1052"></Status>
</Scan>
</subsonic-response>

Code: Select all

<subsonic-response xmlns="http://subsonic.org/restapi" status="ok" version="1.9.0">
<Scan>
<Status started="false"></Status>
</Scan>
</subsonic-response>
Best regards
osef
Posts: 1
Joined: 25 May 2014, 11:20
Has thanked: 0
Been thanked: 0

Re: [Script] Script to rescan MediaFolders

Unread post by osef »

Hello,

how to do this on linux please ?

Cordially.
rZn
Posts: 4
Joined: 07 Feb 2013, 04:33
Has thanked: 9 times
Been thanked: 3 times

Re: [Script] Script to rescan MediaFolders

Unread post by rZn »

osef wrote:Hello,

how to do this on linux please ?

Cordially.
Just use these two in a browser

http://localhost:4040/rest/startRescan. ... =WebScript

http://localhost:4040/rest/scanstatus.v ... =WebScript

rZneX
These users thanked the author rZn for the post:
rick
Rating: 7.69%
addseo1115
Has thanked: 0
Been thanked: 0

Re: [Script] Script to rescan MediaFolders

Unread post by addseo1115 »

Just use these two in a browser.
Post Reply