Skip to content

Commit

Permalink
modify rss title
Browse files Browse the repository at this point in the history
  • Loading branch information
Izumiko committed Jul 13, 2024
1 parent 7e0dfc0 commit dbafe77
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions server/rss.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,18 @@ const route = async (req, res) => {
const episodeWithOffset =
Number.parseInt(episode) + (Number.parseInt(offset) || 0);
const epWithPadding = episodeWithOffset.toString().padStart(2, "0");
const normalized = `${series} - S${season}E${epWithPadding} - ${language} - ${quality}`;
let group = '';
if (match?.groups?.subgroup) {
const { subgroup } = match.groups;
group = `[${subgroup}] `;
} else {
const res = title.match(releaseGroup);
if (res?.groups?.subgroup) {
const { subgroup } = res.groups;
group = `[${subgroup}] `;
}
}
const normalized = `${group}${series} - S${season}E${epWithPadding} - ${language} - ${quality}`;
let newUrl;
if (isMagnet) {
const trackersStr = trackers.toString();
Expand All @@ -68,20 +79,7 @@ const route = async (req, res) => {
} else {
const params = new URLSearchParams();
params.append("url", enclosure[0].$.url);
if (match?.groups?.subgroup) {
const { subgroup } = match.groups;
const fullNormalized = `[${subgroup}] ${normalized}`;
params.append("name", fullNormalized);
} else {
const res = title.match(releaseGroup);
if (res?.groups?.subgroup) {
const { subgroup } = res.groups;
const fullNormalized = `[${subgroup}] ${normalized}`;
params.append("name", fullNormalized);
} else {
params.append("name", normalized);
}
}
params.append("name", normalized);
newUrl = `${torrentProxy}?${params.toString()}`;
}
if (isMikan) {
Expand Down

0 comments on commit dbafe77

Please sign in to comment.