Media sync configuration

This project is not covered by Drupal’s security advisory policy.

This module synchronized media items and files in given folders programmatically.
The module checks if a file is used in an media entity and if it does not saved as a item, it will be created.

Installation:

A) Download the module and unzip it to your modules folder.
B) Second way is to use composer.
$ composer require 'drupal/mediasync:^1.0'

Configuration:

You can finde the configuration form under admin/config/media/mediasync

Folder to sync:
In the first textares (Folder for sync) you have to save the paths of the folders you want to sync. For example . In each line you have to save ONE folder.

Example:

public://webDav
public://ftp

Mapping:
In the second textarea you have to save the mapping rules. One rule in each line.
The first part contains the file extensions ( for example txt, docx, ...), the second part contains the media type (for example file) and the last one contains the name of the file field (for example field_media_file).
File extension => Media type => field name

Example:

png, gif, jpg, jpeg => image =>field_media_image
mp3, wav, aac => audio => field_media_audio
txt, rtf, doc, docx => file =>field_media_file

Tag mapping:
Register the media type, which have to get a tag based on the file path. For each configuration use one line. The first part contains the media type ( for example image), the second part contains the field of the media type, which is related to a vocabulary (for example field_tag), the third one is to say, in which vocabulary the tags have to be saved and the last one contains directories, which could be ignored (for example tmp, test).

Media type => field name => vocabulary => ignore list

Example:
image => field_tag => tags => test

Owner:
He you can configure the owner oft the media entities.

Use:

The synchonization is also starte in the configuration site, after saving the configuration. It would be possible to use the button "Synchronization".

Tasks:

- do not show the start button, when no settings are saved.
- dev(Commit 6c4e0f0): foldernames will be saved as Tags
- register the weight of the directory
- create a geometry media for saving the gps position of jpegs
- Cronjob
- Try/Catch, with Drupal Logging

Project information

Releases