Here's how things stand on my audio file synchronization project. The idea is to loop through the carts on Rivendell system A and ensure that system B has the same carts with identical content.

My previous script, written for Rivendell 2.x, rsync'ed the audio files and wrote the file data directly into the MySQL Rivendell database. This new script, being intended for Rivendell 3.x, uses the web API.

It mostly works. I can't use rsync to transfer the audio files because there's no way to update the LENGTH field via the web API. I therefore have to use the WebAPI IMPORT command. This will result in some unnecessary file transfers, because there's no way to check if the destination copy of an audio file is identical to the source copy. So, if someone changes an end date, the file will be recopied, which it would not via the old script.

Macro carts will not be synchronized, only audio carts. The old script could synchronize macro carts, but there's no web API command to edit macro carts, so they will have to be synchronized manually.

The Conductor field doesn't synchronize. The EditCart command will write to this field, but the ListCarts command always lists the Conductor fielsd as blank, even when it isn't. I'm not sure why.

The Forced Length field doesn't appear to synchronize; if I try to write to itusing EditCut, I get an error message thatthe value is out of range. Since it's the same value as in the source cut, I don't know why that should be happpening. Force Length isn't a feature I ever use, so this doesn't especially bother me.

Why do ListCarts and ListCut sometimes produce data in a different format than that required by EditCart and EditCut? The aforementioned Forced Length is an example; ListCut outpus the data as a string with the format "nn:nn:nn.n", but EditCut wants an integer representing the time in milliseconds. It's no big deal, but odd.


Rob

--
Не думай что всё пропели,
Что бури все отгремели;
Готовься к великой цели,
А слава тебя найдёт.


On Tue, 7 Sep 2021, Rob Landry wrote:


Thanks. I have import working now.

What I am trying to do is synchronize audio files between one Rivendell machine and another.

If a cart on the local system is notpresent on the remote one, it gets added. If it is present, and it's older than the one on the localsystem, it gets replaced.

The EditCart (14) command seems to have a problem with the FORCED_LENGTH field. Any attempt to update that field gives a "Forced length out of range" error. The documentation says it wants an integer in milliseconds, but that may be wrong.


Rob

--
Не думай что всё пропели,
Что бури все отгремели;
Готовься к великой цели,
А слава тебя найдёт.


On Tue, 7 Sep 2021, David Klann wrote:

Hi Rob,

On 9/7/21 7:02 AM, Rob Landry wrote:

OK, so now I'm trying to figure out how to use IMPORT (command = 2).

Do I read correctly in web_api.pdf that the field FILENAME is supposed to
contain the contents, and not the name, of the file to be uploaded?

Unfortunately, the error message I'm getting is "Your browser sent a
request that this server could not understand", which has to be the
most unhelpful error message I've seen since the DEC PDP-8's "WHAT?".


I struggled with this for a while too. Here's what I learned.

The FILENAME field does indeed get the name of the file you are uploading; FILENAME should not included directory separator characters (e.g., "/"). The important piece is that you need to POST the request to the server using a multipart form. I set the following headers in my POST request:

   Content-Disposition: form-data; name="FILENAME"; filename="file.mp3"
   Content-Type: audio/mpeg

You need to make sure that whatever library you're using to create the request also creates the multipart form (or create it manually). The example in the web test code shows how to do an IMPORT: https://github.com/ElvishArtisan/rivendell/blob/master/web/tests/import.html

Hope this helps!

 ~David



Rob

--
Не думай что всё пропели,
Что бури все отгремели;
Готовься к великой цели,
А слава тебя найдёт.

_______________________________________________
Rivendell-dev mailing list
[email protected]
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev

_______________________________________________
Rivendell-dev mailing list
[email protected]
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev

Reply via email to