# Media Duplicate Check

[![Drupal 10](https://img.shields.io/badge/Drupal-10-blue.svg)](https://www.drupal.org/project/drupal)
[![Drupal 11](https://img.shields.io/badge/Drupal-11-blue.svg)](https://www.drupal.org/project/drupal)

## DESCRIPTION

The Media Duplicate Check module prevents accidental duplicate media uploads by checking filenames and showing existing media items.

When users upload files through media forms, the module:
- Automatically detects files with matching filenames
- Shows a preview of existing media items
- Works seamlessly with Media Library and standard media forms

## REQUIREMENTS

- Drupal 10.0+ or Drupal 11.0+
- Media module (core)
- File module (core)

## INSTALLATION

### Via Composer (Recommended)

```bash
composer require drupal/media_duplicate_check
drush en media_duplicate_check
```

### Manual Installation

1. Download and extract the module to `/modules/contrib/media_duplicate_check`
2. Enable the module:
   ```bash
   drush en media_duplicate_check
   ```
3. Clear the cache:
   ```bash
   drush cr
   ```

## CONFIGURATION

Navigate to **Configuration > Media > Media Duplicate Check** (`/admin/config/media/duplicate-check`) to configure the module.

### Available Settings

- **Enable duplicate checking**: Turn the duplicate checking on/off globally
- **Check media types**: Select which media types to check (Image, Document, SVG, Video, Audio, etc.)

## PERMISSIONS

The module respects standard Drupal media permissions:
- Users must have permission to create media to see the duplicate check
- Admin configuration requires "administer site configuration" permission

## SUPPORT

- Issue queue: https://www.drupal.org/project/issues/media_duplicate_check
- Documentation: https://www.drupal.org/docs/contributed-modules/media-duplicate-check

## CONTRIBUTING

Contributions are welcome! Please:
1. Fork the project on Drupal.org
2. Create a feature branch
3. Follow Drupal coding standards
4. Include tests for new functionality
5. Submit a merge request

## MAINTAINERS

Current maintainers:
- [Your Name] - https://www.drupal.org/u/[username]

## LICENSE

This project is licensed under the GPL v2 or later.