File update when loaded in Cart

Hi, I just stumbled over a problem I do not see a workaround for.

Situation is following: News loaded into Cart, automatic download for news runs every hour @ :55 to have the latest update available. The problem is that I get an ‘access denied’ when trying to overwrite the latest edition to the target folder.
Even if we do not preload the news in a cart, what if someone leaves the file in a cart by mistake, no update will take place then.

Hmm, maybe a kinda ‘dummy’ item that could be loaded into the cart firing off the News file via script or whatever could solve the problem.

Any suggestion is welcome.

regards:
-Serge-

At a guess, you would need an Event at :55 that runs a script.

The script would ‘close’ or ‘empty’ the Cartwall Player, then load it with the ‘correct’ file.

I think your problem is caused by giving each news ‘cart’ file the same file name. If you instead name them (for example)
2001-02-08-19-News.mp3
… that would make it much easier, especially for the person who writes the script! :wink:

The file name is in YYYY-MM-DD-HH format, if that is not obvious.

BFN
CAD

Using the same name every hour (news.mp3) can be favorable, depending on the way the file is integrated into the programming. In particular, using the same name allows you to register the file in mAirListDB and use it in the Mini Scheduler.

As soon as the file is loaded into a player, the file is opened in BASS and locked on disk. Even if you were able to overwrite it (e.g. by activating File Management and the RAM option), BASS wouldn’t recognize the new version if the player has already been loaded.

Good points all, Torben, but Serge seems to specifically want his News file in a Cartwall Player (unless I misunderstand him?), so Mini Scheduler and mAirListDB don’t really apply here. I do however accept that he may just prefer something like news.mp3 or some other ‘single’ name for all news files.

So, I think what he requires is a script which will ‘scan’ all the Cartwall Players, and if the ‘news.mp3’ file is loaded into any of them (including in a Cart Stack ::)), then either Close that Player, and/or remove the item from any Stack it is in, as appropriate.

Having said that, I’m not sure how one would actually remove an item from a Playlist using a script, since I can’t see a Method to do that? And I’m assuming (guessing) that to remove an item from a Cart Stack, you would do this by removing an item from the ICartPlayer control’s IPlaylist, so it seems a relevant question to ask!

Anyway, that is how I would approach the writing of the script, given the requested result and the potential problems Serge has mentioned.

BFN
CAD

To answer CAD’s suggestion. The filename has to be the same. It’s been used all throughout our scheduling software, in the rotation lists, scripts, etc… Keeping the name always the same is really favorable in this case.

OK, it can be done via a script that scans the carts and if it finds the news file, simply ejects the appropriate cart.
However, I don’t feel comfortable with it. Running this script at :50 or somewhere would kick a presenters news off the cart that he might already have loaded for playing on top of the hour.

A method to prevent BASS from touching the file would be the right solution.
Something like the ‘Silence’ Item but for cart players with ‘action on start’ would probably do the trick.

regards:
-Serge-

First of all, let me repeat what I wrote above:

mAirList will always open, analyze and buffer the file in the moment it is loaded into the player. A new version of the file - even if you were able to overwrite it (see below) - wouldn’t be detected until you reload the player. So if the presenter loads the cart player at :50, and starts it at :00, it will play the version that existed at :50, even if it was overwritten at :55.

This is actually a good thing. Imagine mAirList wouldn’t open the file until you try to start the player. That would mean that you might get a noticable latency in playback (opening a file can take a second when it’s on a network drive or so), and also that you wouldn’t see a possible “file not found” error until the very moment it is supposed to be on air -> BANG!

Regarding the “access denied” issue, I think File Management is the key here, because it is able to copy the file to a temporary location (temp folder or RAM, respectively) before opening it in BASS. At the moment, there are only rules to do so with files that are below a given size, or that are located on a network share. But it would be very easy to add options like “Always load file into RAM” or “Always create a temporary copy” to the list of playlist item options so that File Management is forced on for this particular item. Then you would at least be able to overwrite the file. You would still need a script that reloads all possibly loaded cartplayers though.

Cad, to delete an item from an IPlaylist, use the Delete method. It’s defined in the IBaseList super-interface. The interface hierarchy is actually:

IObservable -> IUpdateObject -> IBaseList -> IObservableList -> IPersistentList -> IPlaylist (-> IPlaybackControl)

Too bad that DelphiCodeToDoc doesn’t place any links to the super-interfaces onto the pages where the methods of a particular interface are listed. Only the direct ancestor is mentioned.

Oh, I’m well aware about the latency by using the method I suggested. One or 2 seconds one could live with, as it only affects this particular news file loaded in the cart. The presenters only make use of them when the show lasts more than one hour.
‘Updating’ the cart would then also not be necessary.

OK, one could argue about the ‘file not found’ issue… but isn’t it the same for a playlist item that gets loaded via a ‘Silence’ item via the ‘action on start’ option ?

But coming back to the File Managment thing. Copying it to a temporary location on the local disk would be OK for me.
Only thing I don’t see at the moment:

  • how to apply this local copy rule for only the News file.
  • and how to set it for files loaded into the cartwall

regards:
Serge

As mentioned above, I would add two new options to the list of playlist item options. You can make them permanent by creating an MMD file for it, or setting the options in the cart set, respectively. It’s not possible to set the option automatically for all items loaded into the cartwall though. That would require a new player option as well. I’m not sure about the effort that would take.

If you’re ok with the delay and the “file not found” risk, you can still try to find a solution using a Silence item and start actions or so. But the general way the player works (file is buffered when it’s opened) cannot be changed.

Before changing something, let me check why I have disabled the ‘cache network files’ option. I remember something there…
Apparently I must have disabled it, otherwise I would not get the ‘access denied’, right?

All our files are on a NAS and the NAS is mapped as a drive letter locally. I suppose that a mapped network drive gets recognized as network share?

Adding a silence element to the cartplayer will just drop the file specified under ‘action on start’ to one of the players. So that’s not an alternative.

If the local caching works, I believe that’s the solution then. I’ll try that tonight…

regards:
-Serge-

Hi, just picked this thread up. access denied when writing or overwriting a file on a nas could be windows at fault (assuming its a windows system) SP3 normally fixes this issue.

If you stick with SP2 its down to Google to find a solution which ususllly means a registry edit.

hth Tony

Thanks for the hint, Tony, but I believe it’s really BASS that has the file locked. Makes sense, after all. And that’s also the reason why you can’t update any file tags while the file is opened in a player (one more reason to use MMDs instead).

Serge, network files aren’t recognized when using a mapped drive letter. I’m pretty sure there is a way to find out whether a particular drive is a network drive, but I haven’t looked into that yet.

Ok that was my first thought too and therefore I pointed that out.
And regarding Tony’s statement, it’s really BASS that’s locking the file. If I eject it, overwriting works without a problem.

Right now, the only solution is to teach the presenters to reload the news every hour and always eject the news before leaving.
But we can bet a beer on what will happen soon, preventing the news from being updated…

Using a local copy for the carts would overcome the problem that the automatic hourly download to the NAS fails, but still there’s the problem on updating the local file if it’s loaded in a cart.

There might be a solution to use indirect addressing for the target file when being used on the cartwall… just a matter of finding it ;D

regards:
-Serge-

[FX: Thud Thud Thud Thud Thud]

Ah, that’s better! I’ve stopped banging my head of the desk now!

And I’ll try to remember this the next time I need to find a method or whatever. Well, I’ll probably remember.

BFN
CAD

I’m coming back to the subject and eventually see an easy solution (concerning my setup) to the problem.
News are usually loaded to a cart as stack together with the news sweeper and the news itself.

So if I could run a script or event triggered script to reset the cart stack to item 1 would free the news file from being locked prior to the update of the file.

Question is:
Is there a scripting method to select an item of a stack from a cart? Or as an alternative, could the same command be sent via the REST interface?

regards:
-Serge-

It would look something like:

CurrentCartwall.GetPlayerControl(0).SetStackIndex(0)

HOWEVER, as I have never tried to script the Cartwall, before, I’m not sure a) what ‘CurrentCartwall’ should be in reality (CurrentCartwall and Cartwall don’t seem to work in mAirListScript); and b) whether I’ve got the syntax of the command correct.

Hopefully Torben will tell us both how to do this properly! ;D

BFN
CAD

Please download the latest snapshot, Build 899, which includes a bugfix related to the cartwall and scripting, and some convenient “shortcuts” to access the cartwall more easily from a script.

You can then use the following script to set go to the beginning of the cart stack of the first player. Pretty much like Cad suggested.

begin
  Cartwall.GetPlayer(0).SetStackIndex(0);
end.