Skip to content

Commit

Permalink
fix: Replace mii url to Nintendo's CDN.
Browse files Browse the repository at this point in the history
  • Loading branch information
Repflez committed Jul 3, 2023
1 parent ae78ca3 commit dbeebd1
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,10 @@ public static function uploadDrawing(string $data) : string
*/
public static function uploadMii(string $data) : string
{
// TODO: Do this in a way better way.

// Get filename from Nintendo CDN
$components = explode("/", $data);
$filename = last($components);

// Store avatar in server.
file_put_contents(path("stuff/avatars/$filename"), file_get_contents($data));

return sprintf("%s/avatars/%s", config("general.image_url"), $filename);
return sprintf("http://mii-images.account.nintendo.net/%s", $filename);
}
}

0 comments on commit dbeebd1

Please sign in to comment.