INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Accessing mapped folders... extra steps for the first time  (Read 3103 times)

DaremoS

  • World Citizen
  • ***
  • Posts: 151
  • Rock is not just music... is a way of living

In my main PC, under windows XP, I access my music files in several folders (drives C, D & E), and also I access 3 mapped folders located in my second PC (drives J, K & L), everything works fine as all is properly set concerning sharing and permissions.
But from my MC 12.0.233, when I load the program for first time after booting, files from the mapped folders appears as not available, and I can't access them until I enter into each mapped folder from MC through "Drives & Devices" menu, after this, for the rest of the session, files in mapped folders are fully available.
It seems like it's needed to reactivate the connection within MC to that external folders.
Thanks in advance for your help.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Accessing mapped folders... extra steps for the first time
« Reply #1 on: May 30, 2007, 11:06:03 am »

I'd really like this as well.  I keep my computers up and running all the time, so it doesn't happen to me that much, but it'd be nice if MC was able to somehow try to re-connect to the drives when you either: a) first open the app, or b) try to play a file on a network drive.  As it is, the files fail to play back even though the network drive is certainly available, just needs to be "opened" to be reconnected.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42344
  • Shoes gone again!
Re: Accessing mapped folders... extra steps for the first time
« Reply #2 on: May 30, 2007, 12:35:35 pm »

Is it possible you're accessing the mapped drive with different credentials than you mapped it with?

Vista with UAC causes this problem for me at home.  Somehow viewing the drive with My Computer in MC will authorize the connection, but we haven't been able to find any documentation for how to do this from code.

If anyone can point us in the right direction, we'd be happy to add support.
Logged
Matt Ashland, JRiver Media Center

maxxsid

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 865
Re: Accessing mapped folders... extra steps for the first time
« Reply #3 on: May 30, 2007, 12:46:44 pm »

Yes, please, I would like something like this too!
This used to be a big problem for me since I put my server to sleep (to conserve the energy).
Now, I wake up the server before using MC and everything goes well unless I forget to wake it up - then I have to go to that shared drive and open a folder.

It would be nice if MC would check the server status and send a WOL if it's off or asleep.
I can set my server to wake up on network activity but it's not very nice since it wakes up on any activity i.e. when it's not really needed.

On my HTPC (which is also normally asleep) I use a 3rd party applet which runs when HTPC wakes up, fires up a script which wakes the server up and opens a folder. It also copies the latest version of the library.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Accessing mapped folders... extra steps for the first time
« Reply #4 on: May 30, 2007, 01:01:13 pm »

Is it possible you're accessing the mapped drive with different credentials than you mapped it with?

No.  Definitely not.  And I'm experiencing this on XP Pro (so no UAC weirdness).  I don't know if it makes any difference, but I do use Offline files and have that support enabled on my different computers, though I don't have any of the media folders set up for Offline use (other folders on other Network Drives are).  I find the issue generally happens like this:

1. My "server" machine (the one hosting the physical drive where the shared folder lives) has been rebooted or is shut down for some reason, but the "host" machine (the one trying to use the network drive via MC) has remained up.

2. While the server machine is down, Windows updates the Network Drive status to disconnected.

3. I boot the "server" machine back up, but do not try to access any of it's drives via the "host" machine in Windows Explorer at all.  I simply open MC.

4. MC will list all of the files on the Network Drive as missing (with the X icon) and they will not play.

5. If I either: A) Open Windows explorer and double click on the drive to open it, or B) navigate to the drive via Drives and Devices inside MC then MC is again able to find and play the files.

As far as how to do it programmatically in C++, I can't help you there.  Is there simply any way you can do a "browse" command on only network drives?  It appears the browse "action" forces Windows to try to reconnect the drives...
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42344
  • Shoes gone again!
Re: Accessing mapped folders... extra steps for the first time
« Reply #5 on: May 30, 2007, 01:02:05 pm »

Another tricky thing is that it's hard for MC to know what events should trigger trying to reconnect a drive.

Should auto-import?  How about building thumbnails?  Should it be able to show a login/password if necessary?
Logged
Matt Ashland, JRiver Media Center

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Accessing mapped folders... extra steps for the first time
« Reply #6 on: May 30, 2007, 01:03:30 pm »

Another tricky thing is that it's hard for MC to know what events should trigger trying to reconnect a drive.

Should auto-import?  How about building thumbnails?  Should it be able to show a login/password if necessary?

I would say only on Playback.  Other stuff can wait.  And, yes, since the user is actively trying to play something, it should request logon creds if needed (though this would be pretty rare and only happen if you had set up your user accounts oddly).
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

ThoBar

  • Citizen of the Universe
  • *****
  • Posts: 992
  • Was confishy
Re: Accessing mapped folders... extra steps for the first time
« Reply #7 on: May 30, 2007, 10:34:08 pm »

Until JR comes up with built in support, here's my little work around (that really needs to updated to use either VBScript or JScript...)


Create a batch file.... (I've called mine autocon.cmd)

Code: [Select]
@echo off

REM USAGE: autocon <driveletter>  <servername>  <sharename>
REM Tests if a drive letter responds to a "dir" command, otherwise it attempts to remap it...
REM If any parameters are missing fromt the command line, it defaults to presets for that parameter

setlocal

if not [%1]==[] (
set drive=%1
)else (
set drive=z
)



if not [%2]==[] (
set ipaddress=%2
)else (
set ipaddress=MainServer
set sharename=shares
)



if not [%3]==[] (
set sharename=%3
)else (
set sharename=shares
)


echo Drive=%drive%
echo IP=%ipaddress%
echo Share=%Sharename%

dir %drive%:\ > nul 2>&1 || (

echo Directory listing of drive failed. Assuming lost connection.
echo Pinging: %ipaddress%...

ping -n 1 -w 5 %ipaddress% | find /i "reply" > nul

if errorlevel 1 (
echo Ping failed.
exit /b
) else (
echo Ping succeeded.
echo Deleting existing shares...
net use \\%ipaddress%\%sharename% /del >nul 2>&1
net use %drive%: /del >nul 2>&1
echo Re-mapping shares... (\\%ipaddress%\%sharename%)
net use %drive%: \\%ipaddress%\%sharename% /persistent:yes >nul 2>&1 || echo Drive mapping failed. (%errorlevel%)
)

rem mc12 /silentimport
)

endlocal
exit /b

Create a shortcut to this batch file... you should see "Shorcut to autocon.cmd"
  Edit the properties of said shorcut... make sure it is set to "Start Minimised"

Create a new Scheduled Task...
  Set the Run command to...
    "C:\Shortcut to autocon.cmd.lnk" Z MainServer Recent >nul
  Note the quotes... they are necessary if you have spaces in the shortcut name.

Configure your Task to run every minute or 5 or however often you want it to run....
  Make sure it runs manually!
  Make sure you watch it the first time Scheduled to ensure it works!

Works for me :)

C.
Logged

skeeterfood

  • Citizen of the Universe
  • *****
  • Posts: 779
  • We're all just food for the skeeters.
Re: Accessing mapped folders... extra steps for the first time
« Reply #8 on: May 31, 2007, 02:19:24 pm »

I can not say if this will fix the problem, but according to this Microsoft KB article, you can turn off XP/Server 2003's Server auto-disconnect feature.

My work XP laptop's default was set to 15 minutes and the following command changed it to -1 (supposedly disabled):
c:\> net config server /autodisconnect:-1

I'm not sure if that command survives a reboot, or if you have to do the registry edit method, the KB article doesn't say.

I've never had my connections spontaneously disconnect, but when I reboot my HTPC, or go into and out of standby, the drives come up mapped, but disconnected until I browse to them...

-John
Logged

DaremoS

  • World Citizen
  • ***
  • Posts: 151
  • Rock is not just music... is a way of living
Re: Accessing mapped folders... extra steps for the first time
« Reply #9 on: June 01, 2007, 08:23:41 am »

skeeterfood... thanks for the link, reading it I noticed that Windows XP is not mentioned in operating systems implied.
Anyway, here is something interesting. In this excerpt of such article:
"if you map a drive to a network share, the mapped drive may be disconnected after a regular interval of inactivity, and Windows Explorer may display a red "X" on the icon of the mapped drive. However, if you try to access or browse the mapped drive, it reconnects quickly."
In my Windows XP it never was a red "X", but a green light, meaning that the connection was always alive.

So the problem must be within MediaCenter... prior to version 12.0.240.

Now I am using version 12.0.240, and the problem seems to have been fixed.
I can now access files in mapped folders at the moment I load the program and works fine... and there is no yellow light visible on those files.
I'll see if it continues so as is the first time I use it after a boot.


Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Accessing mapped folders... extra steps for the first time
« Reply #10 on: June 01, 2007, 11:41:01 am »

Just so you are aware... Matt is currently working on a potential solution to this issue from inside MC, in the beta versions.  It's experimental, but there may be something coming that will make this a non-issue for the future.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/
Pages: [1]   Go Up