INTERACT FORUM

Please login or register.

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

Author Topic: MC library server deletes file when using MCWS /File/GetFile request  (Read 5939 times)

abachem

  • Recent member
  • *
  • Posts: 20

I am using 2 MC library servers (v21.0.50) (MC-1, MC-2) in a LAN on a MacMini (MC-1) and MCBookPro (MC-2) (with different access keys). The files of a master library 'ML' of MC-1 are stored on a NAS (TimeCapsule) in the LAN. MC-2 uses this library as a client (in sync mode). Everything works perfect with this installation.

The problem starts, if I use the MCWS on MC-2 to execute a '/MCWS/v1/File/GetFile?File=key&Conversion=4'-request in a Safari-Browser-page on MC-2 to fill the src-attribute of an HTML5 audio element. The file downloads and (if clicked) plays in the browser (on the default audio device), but shortly after the file is fully downloaded its deleted on the NAS (TimeCapsule). On MC-1 (in the corresponding zone display) the filename vanishes and is replaced by 'GetFile -Cache MP3 high (number).mp3'. The display is not updated on MC-2. Clicking (in MC-1) on a track (where the file is deleted) shows the error message 'Tagging Error', Media Center encountered errors while tagging or moving files....'.

Here is the 'squeezed down to the error' HTML-page which causes this deleting of files

Code: [Select]
<!-- Testpage for reproducing 'deleting-media-file-error' -->
<!doctype html>
<head>
<meta charset='utf-8'>
                <meta name='viewport' content='width=device-width, initial-scale=1.0' />
                <title>Testpage for error reproduction</title>
               <script src='/media/jsab/jquery-2.1.4.min.js'></script>
</head>
<body>
<h1 id='start'>Testpage for reproducing deleting-media-file-error: Klick here</h1>
<div><audio id='a' src='' type='audio/mpeg' controls></audio></div>

<script>
var token ='37aZdIOU';
$('#start').click( function() {
var filekey = '7906099';
$('#a').attr('src','http://user:password@10.0.1.15:52199/MCWS/v1/File/GetFile?File='+filekey+'&Conversion=4&Token='+token);
$('a').load();
});
</script>
</body></html>

I do not know, if this is an MC-error or my error using 'File/GetFile' in wrong way. Any hints would be very valuable.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: MC library server deletes file when using MCWS /File/GetFile request
« Reply #1 on: February 21, 2016, 08:35:52 am »

I believe it is because you are using the Conversion flag. That creates transient files for streaming, which are automatically removed after use. It is the converted file MC is creating that is being deleted, right?
Logged
"Some cultures are defined by their relationship to cheese."

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

abachem

  • Recent member
  • *
  • Posts: 20
Re: MC library server deletes file when using MCWS /File/GetFile request
« Reply #2 on: February 21, 2016, 09:33:12 am »

no, unfortunateley not. It is the original .flac-file which is deleted. The converted file will also be deleted as soon as the play in the web finishes.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: MC library server deletes file when using MCWS /File/GetFile request
« Reply #3 on: February 21, 2016, 09:45:55 am »

Woah! That's not good.

I'll need to test it to see what might be going on. One thing, why do you have a token value hardcoded?  Was that just to simplify your code for demonstration purposes?
Logged
"Some cultures are defined by their relationship to cheese."

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

abachem

  • Recent member
  • *
  • Posts: 20
Re: MC library server deletes file when using MCWS /File/GetFile request
« Reply #4 on: February 21, 2016, 10:19:03 am »

yes, just to make it as compact as possible. I am working on a web remote for JRiver collecting all available information of web services (rovi,wikidata,wikpedia,musicbrainz and so on) for classical music metadata of the music file which is just playing in Playing Now of a selected zone and for this reason I have also included a web player similiar to Gizmo or JRemote in my project. All works fine, but I do have this problem for the zone "this device". The code snipet is just the error which causes the problem.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42373
  • Shoes gone again!
Re: MC library server deletes file when using MCWS /File/GetFile request
« Reply #5 on: February 22, 2016, 07:51:19 am »

I'm trying to reproduce this, but I must be missing a step because it works fine.

I enter this URL:
http://localhost:52199/MCWS/v1/File/GetFile?File=931&FileType=Key

That downloads the file with the web browser.  Then I switch back to Media Center and play it no problem (so it hasn't been deleted).

Is it only if you specify conversion or something?  

Well I tried to specify a conversion and that also worked fine.

Thanks.
Logged
Matt Ashland, JRiver Media Center

abachem

  • Recent member
  • *
  • Posts: 20
Re: MC library server deletes file when using MCWS /File/GetFile request
« Reply #6 on: February 22, 2016, 09:49:01 am »

Thanks Matt for checking. Perhaps I was not precise enough. My point is not downloading files using MCWS 'File/GetFile'-requests. This works fine without any problem as long as I address this request to the library server to which this library is local. My problem arises when I address this request to the library server MC-2 which uses the library of another MC library server (MC-1) as a client. Then on MC-1 the files were deleted.

But I can solve my problem by just adressing the request allways to a library server which 'owns' the library respec. where the library is local and not making things more complex than neccessary.

Thanks again.

Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42373
  • Shoes gone again!
Re: MC library server deletes file when using MCWS /File/GetFile request
« Reply #7 on: February 22, 2016, 11:03:57 am »

I connected to a library server and pulled the file (with and without conversion) and the library server didn't erase the file either.
Logged
Matt Ashland, JRiver Media Center

abachem

  • Recent member
  • *
  • Posts: 20
Re: MC library server deletes file when using MCWS /File/GetFile request
« Reply #8 on: February 22, 2016, 11:50:52 am »

Ok, thanks for testing again. Then let me try to test a little be more and come back when I think I can isolate it to a better reproducible test case.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: MC library server deletes file when using MCWS /File/GetFile request
« Reply #9 on: February 22, 2016, 03:37:59 pm »

I connected to a library server and pulled the file (with and without conversion) and the library server didn't erase the file either.

I think the OP is describing this setup:

Server MC with media connected via NAS.
Client MC, connected to Server in "sync mode".
MCWS, run on Client with get file command *and* conversion mode specified.

I think I got that right.  A very specific and somewhat unusual setup.

Brian.
Logged

abachem

  • Recent member
  • *
  • Posts: 20
Re: MC library server deletes file when using MCWS /File/GetFile request
« Reply #10 on: February 23, 2016, 12:46:21 am »

I think it can make sense in a developer enviroment: 1 'production' machine, 1 'developer' machine, both with its own MCWS & web server, both accessing the same physical files on a NAS with the option for the developer installation to test (as a client) with the 'production' library.

Achim
Logged
Pages: [1]   Go Up