Don't use "NR" in the ISDCF name if there is no rating.
authorCarl Hetherington <cth@carlh.net>
Fri, 2 Dec 2022 20:52:38 +0000 (21:52 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 2 Dec 2022 20:52:38 +0000 (21:52 +0100)
Thierry says this is not used out in the wild, and I can't find
any reference to say that it must be there, so remove it.

src/lib/film.cc
test/isdcf_name_test.cc

index 8b1442849488de289d226c2ee2dbc98d0e3dad85..29952d0f2e8f57fe6e10a7920af1fbce42940338 100644 (file)
@@ -970,9 +970,7 @@ Film::isdcf_name (bool if_created_now) const
        if (_release_territory) {
                auto territory = _release_territory->subtag();
                isdcf_name += "_" + to_upper (territory);
-               if (_ratings.empty ()) {
-                       isdcf_name += "-NR";
-               } else {
+               if (!_ratings.empty()) {
                        auto label = _ratings[0].label;
                        boost::erase_all(label, "+");
                        boost::erase_all(label, "-");
index d64f45b899cf7c9878df976345e4c4bb1b4c143f..b1561289581e9f35a216a4e148f05c99d6b85e3d 100644 (file)
@@ -232,5 +232,10 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test)
        /* Check that the proper codes are used, not just part of the language code; in this case, QBP instead of PT (#2235) */
        film->set_audio_language(dcp::LanguageTag("pt-BR"));
        BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_QBP-fr_US-R_71-HI-VI_4K_DI_20140704_PPF_SMPTE_OV");
+
+       /* Check that nothing is added for non-existant ratings */
+       film->set_ratings({});
+       BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_QBP-fr_US_71-HI-VI_4K_DI_20140704_PPF_SMPTE_OV");
+
 }