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

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Neutral
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.4
    • Component/s: None
    • Labels:
      None

      Description

      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>

        Checklists

        Acceptance criteria

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Date of First Response:

                    Checklists

                    DoD