Skip to content

Commit b139b6a

Browse files
committed
fix resize and rename absolutePath() to path(). (in LfmItem)
1 parent 2b0a464 commit b139b6a

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/LfmItem.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ public function name()
4242
return $this->lfm->getName();
4343
}
4444

45-
public function absolutePath()
45+
public function path($type = 'absolute')
4646
{
47-
return $this->lfm->path('absolute');
47+
return $this->lfm->path($type);
4848
}
4949

5050
public function isDirectory()

src/controllers/DeleteController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function getDelete()
1919

2020
foreach ($item_names as $name_to_delete) {
2121
$file_to_delete = $this->lfm->pretty($name_to_delete);
22-
$file_path = $file_to_delete->absolutePath();
22+
$file_path = $file_to_delete->path();
2323

2424
event(new ImageIsDeleting($file_path));
2525

src/controllers/RenameController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ public function getRename()
4343
$new_file = $this->lfm->setName($new_name)->path('absolute');
4444

4545
if ($is_directory) {
46-
event(new FolderIsRenaming($old_file->absolutePath(), $new_file));
46+
event(new FolderIsRenaming($old_file->path(), $new_file));
4747
} else {
48-
event(new ImageIsRenaming($old_file->absolutePath(), $new_file));
48+
event(new ImageIsRenaming($old_file->path(), $new_file));
4949
}
5050

5151
if ($old_file->hasThumb()) {
@@ -57,9 +57,9 @@ public function getRename()
5757
->move($this->lfm->setName($new_name));
5858

5959
if ($is_directory) {
60-
event(new FolderWasRenamed($old_file->absolutePath(), $new_file));
60+
event(new FolderWasRenamed($old_file->path(), $new_file));
6161
} else {
62-
event(new ImageWasRenamed($old_file->absolutePath(), $new_file));
62+
event(new ImageWasRenamed($old_file->path(), $new_file));
6363
}
6464

6565
return parent::$success_response;

src/views/resize.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="row">
22
<div class="col-md-8" id="containment">
3-
<img id="resize" src="{{ $img->path . '?timestamp=' . $img->time }}" height="{{ $height }}" width="{{ $width }}">
3+
<img id="resize" src="{{ $img->url . '?timestamp=' . $img->time }}" height="{{ $height }}" width="{{ $width }}">
44
</div>
55
<div class="col-md-4">
66

tests/LfmItemTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testAbsolutePath()
5252

5353
$item = new LfmItem($this->lfm_path, $this->lfm);
5454

55-
$this->assertEquals('foo/bar.baz', $item->absolutePath());
55+
$this->assertEquals('foo/bar.baz', $item->path());
5656
}
5757

5858
public function testIsDirectory()

0 commit comments

Comments
 (0)