Menu

scripting / container sort order

emm_is
2008-04-24
2013-05-30
  • emm_is

    emm_is - 2008-04-24

    Hi!

    I was impressed with the photo organisation of twonkymedia (photos->By Date->Year->Month->Day and created a script to add it.

    To make the view attractive to the eye, and easy on the brain, I used month *names* rather than numbers as the default script has. However, month names do not sort in month order.

    I found that, for the ps3, prepending various amounts of spaces allowed the correct sort order. This, fortunately, works for the ps3 because it trims the padding but it is not a general solution. Of course I could just prepend 01, 02, 03 etc but that is a work-round.

    So may I suggest a feature request: that when adding a container one can also, optionally, add a sort index number so items are sorted by index number first and then alphabetically.

    E

     
    • Jin

      Jin - 2008-04-24

      Hi,

      well, for now I would prepend the months with the index. The feature for priority sorting is actually planned, Leo and me talked about it but we did not yet have the time to add it. It is partially available for items (items in playlist containers and in album containers), however it is not available for containers.

      We were actually planning a more sophisticated version, but maybe we can bring something simple sooner, let's see...

      Btw, could you please post your script on the wiki? You would be the first one :>

      It would be nice to have a screenshot along with a short description and the actual js file, thanks!

      Kind regards,
      Jin

       
    • Jin

      Jin - 2008-04-24

      Hi,

      well, for now I would prepend the months with the index. The feature for priority sorting is actually planned, Leo and me talked about it but we did not yet have the time to add it. It is partially available for items (items in playlist containers and in album containers), however it is not available for containers.

      We were actually planning a more sophisticated version, but maybe we can bring something simple sooner, let's see...

      Btw, could you please post your script on the wiki? You would be the first :>

      It would be nice to have a screenshot along with a short description and the actual js file, thanks!

      Kind regards,
      Jin

       
    • Jin

      Jin - 2008-04-24

      Crap, double post :)

       
  • John Glasson

    John Glasson - 2011-12-23

    I wanted to display a descriptive title in my uPnP Photos tree but sort by date.  So I do the following:

    1. Extract EXIF_TAG_USER_COMMENT and substitute this for the obj.title

    2. Treat the container as a music album, and insert a track number into obj.meta  (music Albums are always sorted by track number).

    For track number, I use the IMG_# that my Canon assigns to each picture (eg IMG_3191.jpg). The following code in my addImage script parses the image name and provided that it's numeric replaces obj.meta:

       var TitleArr = obj.title.split(".");
      TitleArr = TitleArr.split("_");
      var nIMG = TitleArr;
      if (isNaN(nIMG)) {obj.meta = 0} else {obj.meta = nIMG};

    var ExifComment = obj.aux;
    if (ExifComment) {obj.title = ExifComment.substr(0,200);}

       
    ….code to build chain here…..

    then…..

    // save as MUSIC_ALBUM to force sort-order by obj.meta
    addCdsObject(obj, createContainerChain(chain), UPNP_CLASS_CONTAINER_MUSIC_ALBUM);

     
  • Diana Lauren Anderson

    Good thinking!

     

Log in to post a comment.