From 57b8b8cd8ce68792c0edb0db4b4c10a49563523c Mon Sep 17 00:00:00 2001 From: santiagosayshey Date: Mon, 24 Jun 2024 08:07:53 +0930 Subject: [PATCH] improvement: Adjusted README to clarify contribution process --- README.md | 134 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 79 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index ea90910..e22792e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Dictionarry Database Repository -This repository contains the database configurations and backups used by the Dictionarry project, supporting both the Profilarr tool and the Dictionarry website. +This repository contains the database configurations and collections used by the Dictionarry project, supporting both the Profilarr tool and the Dictionarry website. ## Overview @@ -8,75 +8,99 @@ Dictionarry aims to simplify media automation via tailored custom formats and pr ## Prerequisites -- **MongoDB**: Ensure MongoDB is installed on your system. -- **MongoDB Compass**: Install MongoDB Compass for a graphical interface to manage your database. -- **Bash**: Ensure Bash is installed on your system. - -## Table of Contents - -- [Setup Instructions](#setup-instructions) -- [Usage](#usage) - - [Restoring the Database](#restoring-the-database) - - [Managing the Database with MongoDB Compass](#managing-the-database-with-mongodb-compass) - - [Shell Scripts for Database Operations](#shell-scripts-for-database-operations) -- [Repository Structure](#repository-structure) -- [Contributing](#contributing) - -## Setup Instructions - -1. Install MongoDB and MongoDB Compass by following the instructions in the [installation guide](https://github.com/Dictionarrry/db/wiki/Installing-MongoDB-&-Compass). -2. Clone this repository to your local machine. - - ```bash - git clone https://github.com/Dictionarrry/db.git - cd db - ``` - -## Usage - -### Restoring the Database - -1. Ensure you have cloned the repository and navigated to the project directory. -2. Run the `restore.sh` script to restore the database from the latest backup file. - - ```bash - ./scripts/restore.sh - ``` - -### Managing the Database with MongoDB Compass - -1. Open MongoDB Compass and connect to your local MongoDB instance. -2. Select the "Dictionarry" database to view and manage its collections. +- **Python 3.6+**: Required to run the database management scripts. ## Contributing -- Follow this guide on best practices when contributing: [Link](https://github.com/Dictionarrry/db/wiki/Best-Practices) +- Follow this guide on best git practices: [Link](https://github.com/Dictionarry-Hub/docs/blob/main/Contributing/git.md) -1. Create a new branch for your changes. +## Custom Formats +1. In a new [regex101](https://regex101.com/) link, add your regex pattern and unit tests. + - Try to include as many edge cases as possible. + - Include at least 5 results that should match and 5 that should not match. + - If there are any particular cases that should be looked at, include a description describing any nessecary details. + - Your page should look something like this: + ![Regex101 Example](Regex101%20Example.png) + + - Take note of the ID of the regex101 link: `https://regex101.com/r//`. For example: + ``` + https://regex101.com/r/GDhflH/4 + ``` + +2. Create a new branch for your changes. ```bash git checkout -b your-branch-name ``` -2. Make your modifications to the database using MongoDB Compass. -3. Run the `dump.sh` script to create a new backup of the modified database. +3. Once you have thoroughly tested your regex pattern, create your custom format inside Radarr / Sonarr and use [Profilarr's Export Tool](https://github.com/Dictionarry-Hub/profilarr?tab=readme-ov-file#exporting) to export the format. + - The result should be a JSON file that contains the format and the regex pattern. + - Move this file to the `/db/custom_formats` directory. + - The result should look something like this: + ```json + { + "name": "Upscaled", + "includeCustomFormatWhenRenaming": false, + "specifications": [ + { + "name": "Upscaled", + "implementation": "ReleaseTitleSpecification", + "negate": false, + "required": true, + "fields": [ + { + "name": "value", + "value": "(Up[-\.\s]?scale|Re[-\.\s]?Grade|AI[-\.\s]?enhanced)" + } + ] + } + ] + } + ``` - ```bash - ./scripts/dump.sh +4. Replace the line containing "value" and the regex pattern with "regexID" and the ID of the regex101 link. + ```json + { + "name": "Upscaled", + "includeCustomFormatWhenRenaming": false, + "specifications": [ + { + "name": "Upscaled", + "implementation": "ReleaseTitleSpecification", + "negate": false, + "required": true, + "fields": [ + { + "name": "value", + "regexID": "GDhflH" + } + ] + } + ] + } ``` -4. Commit your changes and the new backup file. +## Quality Profiles +1. Create a new branch for your changes. + ```bash + git checkout -b your-branch-name + ``` +2. Create and test your quality profile in Radarr / Sonarr. +3. Export the quality profile using exportarr and move the JSON file to the `/db/quality_profiles` directory. + +## Pushing Changes + +1. Commit your changes and push the branch to the repository. ```bash git add . - git commit -m "Your commit message" + git commit -m "Add custom format: Upscaled" + git push -u origin your-branch-name ``` -5. Push your branch to the remote repository. - - ```bash - git push origin your-branch-name - ``` - -6. Create a pull request on GitHub to propose your changes. +2. Open a pull request on GitHub, providing a detailed description of your changes and the purpose of the custom format. Make sure to include: + - The regex101 link. + - Any outstanding issues or edge cases that should be considered. + - The PR should be merged into the `dev` branch. +3. Wait for the maintainers to review your pull request. They may provide feedback or request changes before merging your contribution. \ No newline at end of file