Skip to content

Commit

Permalink
fix(movies): Remove uhd from a movie's filename when setting a title
Browse files Browse the repository at this point in the history
  • Loading branch information
bugwelle committed Jul 20, 2024
1 parent 6745a44 commit c225255
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/settings/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ void Settings::loadSettings()
"multisubs,ntsc,ogg,ogm,pal,pdtv,proper,repack,rerip,retail,r3,r5,bd5,se,svcd,swedish,german,"
"nfofix,unrated,ws,telesync,ts,telecine,tc,"
"brrip,bdrip,480p,480i,576p,576i,720p,720i,1080p,1080i,2160p,"
"hrhd,hrhdtv,hddvd,uhdtv,uhdv,bluray,"
"hrhd,hrhdtv,hddvd,uhdtv,uhdv,bluray,uhd,"
"x264,h264,h.264,h.265,h265,hevc,web-dl,"
"xvid,xvidvd,xxx,www,mkv")
.split(",", ElchSplitBehavior::SkipEmptyParts);
Expand Down
21 changes: 20 additions & 1 deletion test/unit/file/testNameFormatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,22 @@ TEST_CASE("NameFormatter formats names", "[rename]")
{
// Just some words to search for.
QStringList defaultExcludeWords{
"ac3", "dts", "divx5", "dsr", "dvd", "dvdrip", "fs", "hdtv", "480i", "720p", "1080p", "bluray", "h264", "mkv"};
"ac3",
"dts",
"divx5",
"dsr",
"dvd",
"dvdrip",
"fs",
"hdtv",
"480i",
"720p",
"1080p",
"bluray",
"h264",
"mkv",
"uhd", //
};

SECTION("excludeWords works as expected")
{
Expand All @@ -25,6 +40,10 @@ TEST_CASE("NameFormatter formats names", "[rename]")
CHECK(NameFormatter::excludeWords("my-480i-movie") == "my movie");
CHECK(NameFormatter::excludeWords("my.dsr.divx5.480i.movie") == "my movie");
CHECK(NameFormatter::excludeWords("my[480i]movie") == "my movie");

// Issue #1773
CHECK(NameFormatter::excludeWords("THE_MATRIX_(1999)_(BLURAY)") == "THE_MATRIX_(1999)");
CHECK(NameFormatter::excludeWords("THE_MATRIX_(1999)_(UHD)") == "THE_MATRIX_(1999)");
}

SECTION("Only match basic words and not regex special characters")
Expand Down

0 comments on commit c225255

Please sign in to comment.