Skip to content

Commit

Permalink
Remove id from title if present
Browse files Browse the repository at this point in the history
  • Loading branch information
YoungerDryas89 committed Nov 21, 2024
1 parent c718b2f commit caeed84
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/moviescraper/doctord/model/Movie.java
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,11 @@ private void setAllDataItemSources(SiteParsingProfile siteToScrapeFrom) {
* If the appropriate preference is set, add the ID number to the end of the title field
*/
private void appendIDToStartOfTitle() {
if (MoviescraperPreferences.getInstance().getAppendIDToStartOfTitle() && id != null && id.getId() != null && id.getId().trim().length() > 0 && hasValidTitle()) {
title.setTitle(id.getId() + " - " + title.getTitle());
if(id != null && id.getId() != null && id.getId().trim().length() > 0 && hasValidTitle()) {
if (MoviescraperPreferences.getInstance().getAppendIDToStartOfTitle())
title.setTitle(id.getId() + " - " + title.getTitle());
else
title.setTitle(title.getTitle().replace(id.getId(), ""));
}
}

Expand Down

0 comments on commit caeed84

Please sign in to comment.