diff --git a/app/Http/Controllers/SkinlibController.php b/app/Http/Controllers/SkinlibController.php index 17fdda21..f2af7624 100644 --- a/app/Http/Controllers/SkinlibController.php +++ b/app/Http/Controllers/SkinlibController.php @@ -252,7 +252,7 @@ class SkinlibController extends Controller foreach ($results as $result) { // if the texture already uploaded was set to private, // then allow to re-upload it. - if ($result->type == $t->type && $result->public) { + if ($result->public) { return json(trans('skinlib.upload.repeated'), 0, ['tid' => $result->tid]); } } @@ -391,14 +391,6 @@ class SkinlibController extends Controller return json(trans('skinlib.no-permission'), 1); } - $duplicate = Texture::where('hash', $t->hash) - ->where('type', $request->input('model')) - ->where('tid', '<>', $t->tid) - ->first(); - if ($duplicate && $duplicate->public) { - return json(trans('skinlib.model.duplicate', ['name' => $duplicate->name]), 1); - } - $t->type = $request->input('model'); $t->save(); diff --git a/resources/lang/en/skinlib.yml b/resources/lang/en/skinlib.yml index 54b0483a..80b27ee7 100644 --- a/resources/lang/en/skinlib.yml +++ b/resources/lang/en/skinlib.yml @@ -88,7 +88,6 @@ rename: model: success: The texture's model was changed to :model successfully. - duplicate: "The same texture available for the chosen model already exists in skinlib (Name: :name). You can add it to your closet directly." no-permission: You have no permission to moderate this texture. non-existent: No such texture. diff --git a/tests/HttpTest/ControllersTest/SkinlibControllerTest.php b/tests/HttpTest/ControllersTest/SkinlibControllerTest.php index 0d352030..62e95dd7 100644 --- a/tests/HttpTest/ControllersTest/SkinlibControllerTest.php +++ b/tests/HttpTest/ControllersTest/SkinlibControllerTest.php @@ -947,17 +947,6 @@ class SkinlibControllerTest extends TestCase 'hash' => $texture->hash, ]); - // Should fail if there is already a texture with same hash and chosen model - $this->actingAs($uploader) - ->postJson('/skinlib/model', [ - 'tid' => $texture->tid, - 'model' => 'alex', - ]) - ->assertJson([ - 'code' => 1, - 'message' => trans('skinlib.model.duplicate', ['name' => $duplicate->name]), - ]); - // Allow private texture $duplicate->public = false; $duplicate->save();