Utilize Library Item Duration Instead of Module Duration for New Widgets

Howdy,

Here is some of the code for adding a new Library item to a Playlist:

          // Determine the duration
        $itemDuration = ($duration !== null) ? $duration : $item->duration;
        $itemDuration = ($itemDuration == 0) ? $module->determineDuration() : $itemDuration;

Based on this, the Module-level duration is being used as a default if a duration is not specified. I would prefer the duration to be derived from the Library media item itself (which also stores a duration value).

Here’s what I would think should be the use case:

  • When adding a new Media item to the Library, if a duration is not specified store the Module default duration as the duration for the new Media item
  • When adding a new Library Media item to a Playlist, if a duration is not specified store the Media item’s duration as the new widget’s duration.

Could this be implemented in RC2?

Hello

Could this be implemented in 1.8.1?

DENIS

Just to be clear - the change being proposed here only effects the transaction which assigns media from the library to a playlist?

Currently the module’s default duration is taken - after the change the library duration for that item will be taken.

This means that:

  • the module default duration is only applicable for new items in the library (for library based media)
  • changing the module default duration has no effect on new assignments of library media - widget creation

Creating a new widget of a non-library module would use the default duration as it currently does.

Is that correct?

So sorry for the delay answering this. I didn’t see it in my email until today, thanks to errant Spam filters.

Yes, what you said is correct. In particular, the second point ("- changing the module default duration has no effect on new assignments of library media - widget creation") is key here. Once I assign a duration to an existing Library media item, I don’t want that to change.

I’m not a “real” developer so this may or may not help – but I view it as:
-> The Module is the “class” for new instances of a new Library Media item created based on the Module
-> The Library Media item is the “class” for new instances of Widgets created based on the Library item

Does this help? And… thank you!!

I would agree in PetCauseMedia’s idea of how that should work. However, I would like to suggest a slight change.

I think the option to still use the layout’s time setting as a default should still be there. I would think that a checkbox to make the layout over-ride the regular media default should, at least, be an option.

I could easily see how one, such as me(Sorry if I seem selfish), could want an option to make media adhere to a set duration, regardless of the duration already assigned to the media. This is useful to assure playlist stay within their slotted time and all media gets played as agreed. Without this, it is possible media could be played with a longer default time than it should have(mistakes happen), causing the playlist to then extend passed a desired set time. (Which I also think becomes useful moving forward towards having child playlist and making sure they do not mess up schedules.)