mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-20 05:21:27 +00:00
commit
9ad9d74f45
22 changed files with 69 additions and 12 deletions
|
@ -47,6 +47,8 @@
|
|||
- Hydrate `favourited` and `reblogged` state on v1 context endpoint ([abb4f7e1](https://github.com/pixelfed/pixelfed/commit/abb4f7e1))
|
||||
- Improve admin dashboard by moving expensive stats to its page and loading stats and recent data async on the dashboard home page ([9d52b9c2](https://github.com/pixelfed/pixelfed/commit/9d52b9c2))
|
||||
- Update unfollow api endpoint to only decrement when appropriate, fixes #3539 ([44de1ad7](https://github.com/pixelfed/pixelfed/commit/44de1ad7))
|
||||
- Improve cache invalidation after processing VideoThumbnail to eliminate "No Preview Available" on grid feeds ([47571887](https://github.com/pixelfed/pixelfed/commit/47571887))
|
||||
- Use poster in VideoPresenter component ([a3cc90b0](https://github.com/pixelfed/pixelfed/commit/a3cc90b0))
|
||||
- ([](https://github.com/pixelfed/pixelfed/commit/))
|
||||
|
||||
## [v0.11.3 (2022-05-09)](https://github.com/pixelfed/pixelfed/compare/v0.11.2...v0.11.3)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Http\Controllers\Api;
|
||||
|
||||
use Cache;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use League\Fractal;
|
||||
|
@ -10,6 +11,7 @@ use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
|||
use App\Status;
|
||||
use App\Report;
|
||||
use App\Profile;
|
||||
use App\Services\AccountService;
|
||||
|
||||
class ApiV1Dot1Controller extends Controller
|
||||
{
|
||||
|
@ -128,4 +130,40 @@ class ApiV1Dot1Controller extends Controller
|
|||
];
|
||||
return $this->json($res);
|
||||
}
|
||||
|
||||
/**
|
||||
* DELETE /api/v1.1/accounts/avatar
|
||||
*
|
||||
* @return \App\Transformer\Api\AccountTransformer
|
||||
*/
|
||||
public function deleteAvatar(Request $request)
|
||||
{
|
||||
$user = $request->user();
|
||||
|
||||
abort_if(!$user, 403);
|
||||
abort_if($user->status != null, 403);
|
||||
|
||||
$avatar = $user->profile->avatar;
|
||||
|
||||
if( $avatar->media_path == 'public/avatars/default.png' ||
|
||||
$avatar->media_path == 'public/avatars/default.jpg'
|
||||
) {
|
||||
return AccountService::get($user->profile_id);
|
||||
}
|
||||
|
||||
if(is_file(storage_path('app/' . $avatar->media_path))) {
|
||||
@unlink(storage_path('app/' . $avatar->media_path));
|
||||
}
|
||||
|
||||
$avatar->media_path = 'public/avatars/default.jpg';
|
||||
$avatar->change_count = $avatar->change_count + 1;
|
||||
$avatar->save();
|
||||
|
||||
Cache::forget('avatar:' . $user->profile_id);
|
||||
Cache::forget("avatar:{$user->profile_id}");
|
||||
Cache::forget('user:account:id:'.$user->id);
|
||||
AccountService::del($user->profile_id);
|
||||
|
||||
return AccountService::get($user->profile_id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,8 +24,9 @@ class DeleteWorker implements ShouldQueue
|
|||
protected $headers;
|
||||
protected $payload;
|
||||
|
||||
public $timeout = 60;
|
||||
public $tries = 1;
|
||||
public $timeout = 120;
|
||||
public $tries = 3;
|
||||
public $maxExceptions = 1;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
|
@ -72,7 +73,7 @@ class DeleteWorker implements ShouldQueue
|
|||
'h:' . hash('sha256', $actor);
|
||||
|
||||
$lockKey = 'ap:inbox:actor-delete-exists:lock:' . $hash;
|
||||
Cache::lock($lockKey, 10)->block(5, function () use(
|
||||
Cache::lock($lockKey, 30)->block(15, function () use(
|
||||
$headers,
|
||||
$payload,
|
||||
$actor,
|
||||
|
@ -94,30 +95,30 @@ class DeleteWorker implements ShouldQueue
|
|||
if($profile) {
|
||||
DeleteRemoteProfilePipeline::dispatch($profile)->onQueue('delete');
|
||||
}
|
||||
return;
|
||||
return 1;
|
||||
} else {
|
||||
// Signature verification failed, exit.
|
||||
return;
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
// Remote user doesn't exist, exit early.
|
||||
return;
|
||||
return 1;
|
||||
}
|
||||
});
|
||||
|
||||
return;
|
||||
return 1;
|
||||
}
|
||||
|
||||
$profile = null;
|
||||
|
||||
if($this->verifySignature($headers, $payload) == true) {
|
||||
(new Inbox($headers, $profile, $payload))->handle();
|
||||
return;
|
||||
return 1;
|
||||
} else if($this->blindKeyRotation($headers, $payload) == true) {
|
||||
(new Inbox($headers, $profile, $payload))->handle();
|
||||
return;
|
||||
return 1;
|
||||
} else {
|
||||
return;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@ use Storage;
|
|||
use App\Media;
|
||||
use App\Jobs\MediaPipeline\MediaStoragePipeline;
|
||||
use App\Util\Media\Blurhash;
|
||||
use App\Services\MediaService;
|
||||
use App\Services\StatusService;
|
||||
|
||||
class VideoThumbnail implements ShouldQueue
|
||||
{
|
||||
|
@ -72,6 +74,11 @@ class VideoThumbnail implements ShouldQueue
|
|||
|
||||
if($media->status_id) {
|
||||
Cache::forget('status:transformer:media:attachments:' . $media->status_id);
|
||||
MediaService::del($media->status_id);
|
||||
Cache::forget('status:thumb:nsfw0' . $media->status_id);
|
||||
Cache::forget('status:thumb:nsfw1' . $media->status_id);
|
||||
Cache::forget('pf:services:sh:id:' . $media->status_id);
|
||||
StatusService::del($media->status_id);
|
||||
}
|
||||
|
||||
MediaStoragePipeline::dispatch($media);
|
||||
|
|
BIN
public/js/daci-ojtjadoml.js
vendored
BIN
public/js/daci-ojtjadoml.js
vendored
Binary file not shown.
BIN
public/js/dffc-ojtjadoml.js
vendored
BIN
public/js/dffc-ojtjadoml.js
vendored
Binary file not shown.
BIN
public/js/dmyh-ojtjadoml.js
vendored
BIN
public/js/dmyh-ojtjadoml.js
vendored
Binary file not shown.
BIN
public/js/dmym-ojtjadoml.js
vendored
BIN
public/js/dmym-ojtjadoml.js
vendored
Binary file not shown.
BIN
public/js/dsfc-ojtjadoml.js
vendored
BIN
public/js/dsfc-ojtjadoml.js
vendored
Binary file not shown.
BIN
public/js/dssc-ojtjadoml.js
vendored
BIN
public/js/dssc-ojtjadoml.js
vendored
Binary file not shown.
BIN
public/js/home-ojtjadoml.js
vendored
BIN
public/js/home-ojtjadoml.js
vendored
Binary file not shown.
BIN
public/js/post-ojtjadoml.js
vendored
BIN
public/js/post-ojtjadoml.js
vendored
Binary file not shown.
BIN
public/js/profile-ojtjadoml.js
vendored
BIN
public/js/profile-ojtjadoml.js
vendored
Binary file not shown.
BIN
public/js/profile.js
vendored
BIN
public/js/profile.js
vendored
Binary file not shown.
BIN
public/js/rempos.js
vendored
BIN
public/js/rempos.js
vendored
Binary file not shown.
BIN
public/js/rempro.js
vendored
BIN
public/js/rempro.js
vendored
Binary file not shown.
BIN
public/js/spa.js
vendored
BIN
public/js/spa.js
vendored
Binary file not shown.
BIN
public/js/status.js
vendored
BIN
public/js/status.js
vendored
Binary file not shown.
BIN
public/js/timeline.js
vendored
BIN
public/js/timeline.js
vendored
Binary file not shown.
Binary file not shown.
|
@ -22,7 +22,7 @@
|
|||
:alt="altText(status)"/>
|
||||
</div>
|
||||
<div v-else class="embed-responsive embed-responsive-16by9">
|
||||
<video class="video" controls playsinline preload="metadata" loop :data-id="status.id">
|
||||
<video class="video" controls playsinline preload="metadata" loop :data-id="status.id" :poster="poster()">
|
||||
<source :src="status.media_attachments[0].url" :type="status.media_attachments[0].mime">
|
||||
</video>
|
||||
</div>
|
||||
|
@ -76,7 +76,15 @@
|
|||
|
||||
toggleContentWarning(status) {
|
||||
this.$emit('togglecw');
|
||||
}
|
||||
},
|
||||
|
||||
poster() {
|
||||
let url = this.status.media_attachments[0].preview_url;
|
||||
if(url.endsWith('no-preview.jpg') || url.endsWith('no-preview.png')) {
|
||||
return;
|
||||
}
|
||||
return url;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -99,6 +99,7 @@ Route::group(['prefix' => 'api'], function() use($middleware) {
|
|||
|
||||
Route::group(['prefix' => 'v1.1'], function() use($middleware) {
|
||||
Route::post('report', 'Api\ApiV1Dot1Controller@report')->middleware($middleware);
|
||||
Route::delete('accounts/avatar', 'Api\ApiV1Dot1Controller@deleteAvatar')->middleware($middleware);
|
||||
});
|
||||
|
||||
Route::group(['prefix' => 'live'], function() use($middleware) {
|
||||
|
|
Loading…
Reference in a new issue