1. Felix Krull
  2. PhotoFloat-changes

Commits

Felix Krull  committed 2ce80b6 Merge

Merge branch 'master' into build.py

  • Participants
  • Parent commits 70794ad, 1538372
  • Branches build.py

Comments (0)

Files changed (2)

File scanner/CachePath.py

View file
 	return cache_base(path, ensure_has_directory_prefix=True) + "_" + suffix + ".jpg"
 def file_mtime(path):
 	return datetime.fromtimestamp(int(os.path.getmtime(path)))
+
+def replace_platform_seps(path):
+	return path.replace(os.sep, "/")
+
+def replace_indep_seps(path):
+	return path.replace("/", os.sep)

File scanner/PhotoAlbum.py

View file
 		return Album.from_dict(dictionary)
 	@staticmethod
 	def from_dict(dictionary, cripple=True):
-		album = Album(dictionary["path"])
+		album = Album(replace_indep_seps(dictionary["path"]))
 		for photo in dictionary["photos"]:
 			album.add_photo(Photo.from_dict(photo, untrim_base(album.path)))
 		if not cripple:
 		if cripple:
 			for sub in self._albums:
 				if not sub.empty:
-					subalbums.append({ "path": trim_base_custom(sub.path, self._path), "date": sub.date })
+					subalbums.append({ "path": replace_platform_seps(trim_base_custom(sub.path, self._path)), "date": sub.date })
 		else:
 			for sub in self._albums:
 				if not sub.empty:
 					subalbums.append(sub)
-		return { "path": self.path, "date": self.date, "albums": subalbums, "photos": self._photos }
+		return { "path": replace_platform_seps(self.path), "date": self.date, "albums": subalbums, "photos": self._photos }
 	def photo_from_path(self, path):
 		for photo in self._photos:
 			if trim_base(path) == photo._path: