On Nov 23, 2012, at 3:35 AM, Tobias Wunden <[email protected]> wrote:

> 
> the reason for the two catalogs being handled differently is this: So far, 
> there is no "ui way" in Matterhorn to change an episode catalog while the 
> recording is waiting to come in (from the capture agent). But there is one 
> for series, ...Therefore, on ingest, we make sure that the recording is 
> updated with what has been defined on the backend, because the recording may 
> have been scheduled months ago.
> 
> On the other hand, metadata of a single recording might have been changed on 
> the capture agent (such as the Galicaster), which is why the backend leaves 
> that catalog the way we get it.

Tobias,

Thank you for the response. It sounds like the  series catalog in the backend 
(Admin) should take precedence over the ingested series, and the ingested 
episode catalog should take precedence over the backend... 
But, the code is doing the opposite.

Before the ingest method, the addZippedMediaPackage() method checks for series 
catalog in the ingested elements, and calls updateSeries() with it, which 
overwrites the backend (Admin) series. (see snippet below).

Then the ingest method checks new mediapackage with existing mediapackage: if 
an existingCatalog of same flavor exists, skip the conflicting ingested 
catalog, otherwise add the new flavor of catalog to existingMediaPackage. This 
skips the episode catalog of the ingest.

To solve half, can the updateSeries() line be changed to only create series if 
it not already exists? 

Best Regards,
Karen

Ref: 
http://opencast.jira.com/svn/MH/trunk/modules/matterhorn-ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java.
1) Method: addZippedMediaPackage
        // if this is a series, update the series service
        // TODO: This should be triggered somehow instead of being handled here
        if (MediaPackageElements.SERIES.equals(element.getFlavor())) {
          updateSeries(element.getURI());
        }
      }

2) LATER, in ingest()
     // Merge the current mediapackage with the new one
        MediaPackage existingMediaPackage = workflow.getMediaPackage();
               ......
        MediaPackage existingMediaPackage = workflow.getMediaPackage();
        for (MediaPackageElement element : mp.getElements()) {
          if (element instanceof Catalog) {
            // if the existing mediapackage contains a catalog of the same 
flavor, keep the server-side catalog, since
            // it is more likely to be up-to-date
            MediaPackageElementFlavor catalogFlavor = element.getFlavor();
            MediaPackageElement[] existingCatalogs = 
existingMediaPackage.getCatalogs(catalogFlavor);
            if (existingCatalogs != null && existingCatalogs.length > 0) {
              logger.info(
                      "Mediapackage {} already contains a catalog with flavor 
{}.  Skipping the conflicting ingested catalog",
                      existingMediaPackage, catalogFlavor);
              continue;
            }
          }
          existingMediaPackage.add(element);
        }


_______________________________________________
Matterhorn mailing list
[email protected]
http://lists.opencastproject.org/mailman/listinfo/matterhorn


To unsubscribe please email
[email protected]
_______________________________________________

Reply via email to