mirror of
https://github.com/YunoHost-Apps/pixelfed_ynh.git
synced 2024-09-03 20:06:04 +02:00
commit
9ad9d74f45
22 changed files with 99 additions and 42 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);
|
||||
|
|
2
public/js/daci-ojtjadoml.js
vendored
2
public/js/daci-ojtjadoml.js
vendored
File diff suppressed because one or more lines are too long
2
public/js/dffc-ojtjadoml.js
vendored
2
public/js/dffc-ojtjadoml.js
vendored
File diff suppressed because one or more lines are too long
2
public/js/dmyh-ojtjadoml.js
vendored
2
public/js/dmyh-ojtjadoml.js
vendored
File diff suppressed because one or more lines are too long
2
public/js/dmym-ojtjadoml.js
vendored
2
public/js/dmym-ojtjadoml.js
vendored
File diff suppressed because one or more lines are too long
2
public/js/dsfc-ojtjadoml.js
vendored
2
public/js/dsfc-ojtjadoml.js
vendored
File diff suppressed because one or more lines are too long
2
public/js/dssc-ojtjadoml.js
vendored
2
public/js/dssc-ojtjadoml.js
vendored
File diff suppressed because one or more lines are too long
2
public/js/home-ojtjadoml.js
vendored
2
public/js/home-ojtjadoml.js
vendored
File diff suppressed because one or more lines are too long
2
public/js/post-ojtjadoml.js
vendored
2
public/js/post-ojtjadoml.js
vendored
File diff suppressed because one or more lines are too long
2
public/js/profile-ojtjadoml.js
vendored
2
public/js/profile-ojtjadoml.js
vendored
File diff suppressed because one or more lines are too long
2
public/js/profile.js
vendored
2
public/js/profile.js
vendored
File diff suppressed because one or more lines are too long
2
public/js/rempos.js
vendored
2
public/js/rempos.js
vendored
File diff suppressed because one or more lines are too long
2
public/js/rempro.js
vendored
2
public/js/rempro.js
vendored
File diff suppressed because one or more lines are too long
2
public/js/spa.js
vendored
2
public/js/spa.js
vendored
File diff suppressed because one or more lines are too long
2
public/js/status.js
vendored
2
public/js/status.js
vendored
File diff suppressed because one or more lines are too long
2
public/js/timeline.js
vendored
2
public/js/timeline.js
vendored
File diff suppressed because one or more lines are too long
|
@ -3,9 +3,9 @@
|
|||
"/js/activity.js": "/js/activity.js?id=d14e608dd1ecac4d900cd639f2199b62",
|
||||
"/js/components.js": "/js/components.js?id=35beb0748dd5518371686a5f00348fbf",
|
||||
"/js/discover.js": "/js/discover.js?id=0c98508635d6adae9bf8f76c9f5c918c",
|
||||
"/js/profile.js": "/js/profile.js?id=00c33e6d25a12d9c84a78502fdcf7489",
|
||||
"/js/status.js": "/js/status.js?id=795f84b21b8c470d4dc452ee7dcaaf43",
|
||||
"/js/timeline.js": "/js/timeline.js?id=a6166efd95705f96fd952aa979c2dff0",
|
||||
"/js/profile.js": "/js/profile.js?id=f412698e1b61fa70808a65f28ca99c60",
|
||||
"/js/status.js": "/js/status.js?id=9fd2af60a035dd86ff3cb31af111c3b7",
|
||||
"/js/timeline.js": "/js/timeline.js?id=a2a547a3c177ae187ba420c21893e8e8",
|
||||
"/js/compose.js": "/js/compose.js?id=61b03caa8ae7827b689847c19fc99212",
|
||||
"/js/compose-classic.js": "/js/compose-classic.js?id=f11c60795e27213e446054259fdc8b50",
|
||||
"/js/search.js": "/js/search.js?id=4bb81cba317cf1ad35f2c98dce78fd9d",
|
||||
|
@ -17,23 +17,23 @@
|
|||
"/js/story-compose.js": "/js/story-compose.js?id=afe8f35cf52d92ac48ee68a9916d218d",
|
||||
"/js/direct.js": "/js/direct.js?id=29127c125979e275afa50b47d692c892",
|
||||
"/js/admin.js": "/js/admin.js?id=fd88b96423314b41cc763a0714554a04",
|
||||
"/js/rempro.js": "/js/rempro.js?id=03810f85fc35fb2238c518a076fe6b34",
|
||||
"/js/rempos.js": "/js/rempos.js?id=390eecb73b0e650f058df325985db938",
|
||||
"/js/rempro.js": "/js/rempro.js?id=8ad8738264b7e0733f89ca605d6f347c",
|
||||
"/js/rempos.js": "/js/rempos.js?id=47f6c3b3dc7954179a9e2024614449d4",
|
||||
"/js/live-player.js": "/js/live-player.js?id=dd54a729ca39d7eebff1bdb6ef53e236",
|
||||
"/js/spa.js": "/js/spa.js?id=c6c3766979c5b2c2aa6d872cf5ae8bda",
|
||||
"/js/spa.js": "/js/spa.js?id=26ee2e507c8f393b5e5686d1977e593d",
|
||||
"/js/stories.js": "/js/stories.js?id=814a25875cac8987d85c801dcb453114",
|
||||
"/js/installer.js": "/js/installer.js?id=d7b03f6c0bb707bec8ff9f81d328ac4a",
|
||||
"/js/manifest.js": "/js/manifest.js?id=4e6dd9cb251d9698bfccb781db000cca",
|
||||
"/js/home-ojtjadoml.js": "/js/home-ojtjadoml.js?id=aee71e08d2bee651799f655b006bea7b",
|
||||
"/js/home-ojtjadoml.js": "/js/home-ojtjadoml.js?id=a658df800841c9d75af02faa1e2447b0",
|
||||
"/js/compose-ojtjadoml.js": "/js/compose-ojtjadoml.js?id=8c94338835b536bb064bc14247e16a2f",
|
||||
"/js/post-ojtjadoml.js": "/js/post-ojtjadoml.js?id=0d2c0781c29fc6e344e915fb15a11ccf",
|
||||
"/js/profile-ojtjadoml.js": "/js/profile-ojtjadoml.js?id=63e32708677900b9582d6617b1903d8a",
|
||||
"/js/dmym-ojtjadoml.js": "/js/dmym-ojtjadoml.js?id=688e86d82d7b3f43d177f5250a3c7fab",
|
||||
"/js/dmyh-ojtjadoml.js": "/js/dmyh-ojtjadoml.js?id=d326529a8b4499979a99a3e6828c8fbe",
|
||||
"/js/daci-ojtjadoml.js": "/js/daci-ojtjadoml.js?id=e4bd8640fbb005e43d36366d5285c218",
|
||||
"/js/dffc-ojtjadoml.js": "/js/dffc-ojtjadoml.js?id=909f6d2bb6e474e416da9375d2cf33da",
|
||||
"/js/dsfc-ojtjadoml.js": "/js/dsfc-ojtjadoml.js?id=6076fa194e83e8abff4e8c2cd1742f63",
|
||||
"/js/dssc-ojtjadoml.js": "/js/dssc-ojtjadoml.js?id=39fd4059bc9670ca5a3c62d23e5e4827",
|
||||
"/js/post-ojtjadoml.js": "/js/post-ojtjadoml.js?id=e6284016d17450507266f015b8538c04",
|
||||
"/js/profile-ojtjadoml.js": "/js/profile-ojtjadoml.js?id=4a3be90d2e9e40145cb22abee0a091ea",
|
||||
"/js/dmym-ojtjadoml.js": "/js/dmym-ojtjadoml.js?id=d4568ee6f290dd90ba09231493530656",
|
||||
"/js/dmyh-ojtjadoml.js": "/js/dmyh-ojtjadoml.js?id=75dacce771c10b6e31eb97dcb45de367",
|
||||
"/js/daci-ojtjadoml.js": "/js/daci-ojtjadoml.js?id=30bc9689cc686fe10a04dcd73e375e6d",
|
||||
"/js/dffc-ojtjadoml.js": "/js/dffc-ojtjadoml.js?id=5a9e11eea6fd81780a2061445a168828",
|
||||
"/js/dsfc-ojtjadoml.js": "/js/dsfc-ojtjadoml.js?id=b0b2a2e723e876e52d4f57f0bb57567e",
|
||||
"/js/dssc-ojtjadoml.js": "/js/dssc-ojtjadoml.js?id=a1cdd547ab358db866674a708d2823a2",
|
||||
"/js/discover-ojtjadoml.js": "/js/discover-ojtjadoml.js?id=c0789a5495c786e11df7f3df649130f9",
|
||||
"/js/notifications-ojtjadoml.js": "/js/notifications-ojtjadoml.js?id=e1880951a0cf2b07efd767716254a7e5",
|
||||
"/js/dms-ojtjadoml.js": "/js/dms-ojtjadoml.js?id=d0319c4eda168b305b5599802c2a2c8c",
|
||||
|
|
|
@ -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…
Add table
Reference in a new issue