Media library extension 1: abstraction for bundled files
Last saved by Pierre henri Seylan on March 6, 2016
Context:
The media library currently represents the file tree as it is, meaning that all directories of the media library are displayed.
In many use cases, musicians are working with bundled files, which present the same structure as projects files, including:
- a main file
- additional assets, such as audio samples
This document describes an extension of the basic media library, which will allow to display bundled files as single item, and thus abstracting the original directory structure.
1. Specification of bundled files:
A bundled file will be displayed in the similar manor as project's revisions, which appear as single items.
For the media library, the bundled files will be specified in the server backend, in the same way as software.
A media library file bundle contains the following:
- bundle tittle: tittle of main file
- Bundle icon
- Audio preview
2. Creation of bundles files in admin panel :
The specification of bundled files occurs in the admin panel, it will be done as an extension of the software category:
- each software has now an additional checkbox: "bundle"
- when the bundle checkbox is checked, the file is handled as media library bundle, and not tracked as software
- the bundle files should also not appear in the software list in app and website
3. Implementation in app:
The media library must be able to display files as it does now, as well as bundles.
For the bundles files type, the media library makes an abstraction of the file tree and displays a single item.
3.1 Bundles files assets:
Inorder to get the correct assets of the bundle, the media library must perform a scan of the bundled file directory, similar to how projects are tracked.
The key points are:
- the bundle is characterized by the main file (similar to project file for projects)
- the main file is attached to other assets, like projects main files
- to find out the assets attached to the main, a file name comparaison is done
- the app is looking for a stems folder, in the bundle directory, which is named after the main file
- when found, the files are pushed/pulled accordingly
- if not found, the main file is still pushed or pulled
Specs to find assets:
1: stems files are present in main file directory
-> assets
else
2: other assets present in main directory
-> save files as assets and continue check
3: check parent directories names
if parent directories contains a directory containing main file name in tittle
or
if parent directory contain directory named "sample/samples"
->