This guide explains which elements need to be updated whenever a new novel or translator is added. Please update the following sections in dh_mappings.py accordingly.
- File:
dh_mappings.py - Variable:
TRANSLATOR_NOVEL_MAP - Instructions:
- Add the translator's name as a new key if it doesn't already exist.
- Under that key, list all the novel titles (as strings) for that translator.
Example:
TRANSLATOR_NOVEL_MAP = {
"Existing Translator": [
"Existing Novel Title"
],
"New Translator": [
"New Novel Title 1",
"New Novel Title 2"
]
}- File:
dh_mappings.py - Variable:
DISCORD_ROLE_ID_MAP - Instructions:
- Add or update the Discord role ID corresponding to the translator.
- Make sure each role ID is formatted as a string (for example:
"<@&123456789012345678>").
Example:
DISCORD_ROLE_ID_MAP = {
"Existing Translator": "<@&ExistingRoleID>",
"New Translator": "<@&NewRoleID>"
}- File:
dh_mappings.py - Variable:
NOVEL_URL_OVERRIDES - Instructions:
- If the default URL generated by the slug function isn’t correct, add an override entry here.
- The key should be the exact novel title and the value is the correct URL.
Example:
NOVEL_URL_OVERRIDES = {
"Help others? It’s better to help yourself": "https://dragonholic.com/novel/helping-others-its-better-to-help-yourself/",
"New Novel Title": "https://dragonholic.com/novel/new-novel-title/"
}- File:
dh_mappings.py - Function:
get_featured_image(title) - Instructions:
- Update or add a new
ifstatement for the new novel so that it returns the correct image URL. - Skip this step if there is no featured image for the novel.
- Update or add a new
Example:
def get_featured_image(title):
if "New Novel Title" in title:
return "https://dragonholic.com/wp-content/uploads/2024/new-novel-cover.jpg"
# ... existing conditions ...
return ""- File:
dh_mappings.py - Function:
get_nsfw_novels() - Instructions:
- If the new novel is considered NSFW, add its title (exactly as it appears in
TRANSLATOR_NOVEL_MAP) to the list returned by this function.
- If the new novel is considered NSFW, add its title (exactly as it appears in
Example:
def get_nsfw_novels():
return [
"Bondage and Marriage",
"Clap",
"Double Junk",
"My Bloody Valentine",
# ... existing NSFW novels ...
"New NSFW Novel Title" # Add here if applicable
]When adding a new novel or translator, please ensure you update the following:
- TRANSLATOR_NOVEL_MAP:
- Add the translator and/or new novel titles.
- DISCORD_ROLE_ID_MAP:
- Add the corresponding Discord role ID for the new translator.
- NOVEL_URL_OVERRIDES:
- Provide a URL override if the slug generation doesn’t produce the correct URL.
- get_featured_image():
- Map the new novel to its featured image URL.
- get_nsfw_novels():
- If the novel is NSFW, include it in this list.
Following these steps will ensure that your RSS feed generation and related mappings remain consistent and up to date.