Skip to content

Commit

Permalink
Merge pull request #254 from RockefellerArchiveCenter/service-edited
Browse files Browse the repository at this point in the history
Target master_edited dir instead of master
  • Loading branch information
helrond authored Oct 24, 2024
2 parents be437d3 + d5925c6 commit 9d52b69
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions create_derivatives/routines.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ def get_tiff_file_paths(self, bag_path):
tiff_files (list of pathlib.Paths): absolute filepaths for TIFF files.
"""
service_dir = Path(bag_path, "data", "service")
master_dir = Path(bag_path, "data", "master")
for tiff_dir in service_dir, master_dir:
master_edited_dir = Path(bag_path, "data", "master_edited")
for tiff_dir in service_dir, master_edited_dir:
if tiff_dir.is_dir() and any(tiff_dir.iterdir()):
tiff_files_dir = tiff_dir
break
Expand Down
4 changes: 2 additions & 2 deletions create_derivatives/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,15 @@ def test_tiff_file_paths(self):
for fixture_path, expected_service, expected_master in [
("unpacked_bag_with_tiff", False, False),
("unpacked_bag_with_tiff_empty_service", False, False),
("unpacked_bag_with_tiff_master", False, True),
("unpacked_bag_with_tiff_master_edited", False, True),
("unpacked_bag_with_tiff_service", True, False)]:
set_up_bag(settings.TMP_DIR, fixture_path, self.bag_id)
bag = Bag.objects.last()
tiffs = JP2Maker().get_tiff_file_paths(bag.bag_path)
for path in tiffs:
self.assertTrue("data" in str(path))
self.assertEqual("service" in str(path), expected_service)
self.assertEqual("master" in str(path), expected_master)
self.assertEqual("master_edited" in str(path), expected_master)
shutil.rmtree(bag.bag_path)

def tearDown(self):
Expand Down

0 comments on commit 9d52b69

Please sign in to comment.