#2010 - Revise item::find_by_path to search for jpg-converted items.

- added extra $var_subdir argument to item::find_by_path.
- changed item::find_by_path to use $var_subdir to detect if we should look for a jpg-converted item or not (e.g. movie thumbs)
- moved the album thumb detection to item::find_by_path to ensure it knows to look for an exact album match.
- added more sanity checks to item::find_by_path (now has fewer false positive possibilities).

- updated file_proxy to remove the need to guess different movie files.
- updated File_Proxy_Controller - new sanity checks catch previously undetected bug.
- added additional unit tests for item::find_by_path.
This commit is contained in:
shadlaws
2013-02-26 18:39:59 +01:00
parent 81011785aa
commit 251e9d5c8f
4 changed files with 220 additions and 42 deletions
@@ -66,7 +66,7 @@ class File_Proxy_Controller_Test extends Gallery_Unit_Test_Case {
public function movie_thumbnails_are_jpgs_test() {
$movie = test::random_movie();
$name = legal_file::change_extension($movie->name, "jpg");
$_SERVER["REQUEST_URI"] = url::file("var/thumbs/{$movie->name}");
$_SERVER["REQUEST_URI"] = url::file("var/thumbs/$name");
$controller = new File_Proxy_Controller();
$this->assert_same($movie->thumb_path(), $controller->__call("", array()));
}