Uploaded image for project: 'Magnolia DAM Module'
  1. Magnolia DAM Module
  2. MGNLDAM-817

Asset names created from duplication action may create misleading asset types

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 3.0.4
    • None
    • None
    • None
    • Yes
    • UI FW 10
    • 5

      Context

      When uploading an asset, the user has to create asset name. If one recopies the full filename of the file being uploaded, then the file type will be part of the asset (node) name:

      Example asset: Apollo 13 - Houston, We've Had a Problem-172374191.mp3

      The issue

      However, the current mechanism for creating names of duplicated assets negatively affects surface semantics of asset types. If the editor decided to duplicate this asset, he gets .mp4 and ** .mp5 ... and so on:

      instead of something like:

      Apollo 13 - Houston, We've Had a Problem-172374191-0.mp3

      Suggestion:

       When duplicating an asset, the asset names should be parsed for the

       <filename><.><extension-2to4characters>

       pattern and only the <filename> part should be altered:

      • <filename>-0<.><extension>
      • <filename>-1<.><extension>
      • <filename>-2<.><extension>

      Parsing for all the possible extensions could be a problem: [https://en.wikipedia.org/wiki/List_of_filename_extensions

      ]

      Dev notes

      We would not achieve <filename>-0<.>.<extension>in case where filename ends with a number. In the Houston example we will end up with 

      Apollo 13 - Houston, We've Had a Problem-172374192.mp3

      This is to be expected though, can be documented. 

      We can use for Dam assets the getUniqueName from NodeNameHelper.

      Consider also, that the duplicated asset can have a nodename/asset name named completely differently than the file name, so then we would not be going for 

      • <filename>-0<.><extension>

      but rather

      • <assetname>-0<.><extension>

        Acceptance criteria

          1. image-2019-12-12-09-46-59-825.png
            20 kB
            Martin Drápela
          2. image-2019-12-12-09-49-49-076.png
            16 kB
            Martin Drápela
          3. image-2020-08-26-08-12-17-481.png
            4 kB
            Martin Drápela
          4. image-2020-08-26-08-15-45-087.png
            7 kB
            Martin Drápela
          5. image-2020-08-26-08-16-21-067.png
            6 kB
            Martin Drápela
          6. image-2020-08-26-08-18-06-932.png
            5 kB
            Martin Drápela
          7. image-2020-09-01-14-15-12-782.png
            7 kB
            Martin Drápela
          8. image-2020-09-01-14-15-52-111.png
            23 kB
            Martin Drápela
          9. image-2020-09-01-14-22-22-890.png
            19 kB
            Martin Drápela
          10. image-2020-10-22-16-11-58-185.png
            6 kB
            Martin Drápela

              mhaderka Martin Haderka
              mdrapela Martin Drápela
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD