浏览代码

Merge pull request #1789 from pixelfed/staging

Staging
daniel 5 年之前
父节点
当前提交
90917006b3

+ 4 - 0
CHANGELOG.md

@@ -32,6 +32,10 @@
 - Updated ComposeModal.vue, added album support, editing and UI tweaks ([3aaad81e](https://github.com/pixelfed/pixelfed/commit/3aaad81e))
 - Updated InternalApiController, increase license limit to 140 to match UI counter ([b3c18aec](https://github.com/pixelfed/pixelfed/commit/b3c18aec))
 - Updated album carousels, fix height bug ([8380822a](https://github.com/pixelfed/pixelfed/commit/8380822a))
+- Updated MediaController, add timestamp to signed preview url ([49efaae9](https://github.com/pixelfed/pixelfed/commit/49efaae9))
+- Updated BaseApiController, uncache verify_credentials method ([3fa9ac8b](https://github.com/pixelfed/pixelfed/commit/3fa9ac8b))
+- Updated StatusHashtagService, reduce cached hashtag count ttl from 6 hours to 5 minutes ([126886e8](https://github.com/pixelfed/pixelfed/commit/126886e8))
+- Updated Hashtag.vue component, added formatted posts count ([c71f3dd1](https://github.com/pixelfed/pixelfed/commit/c71f3dd1))
 
 ## Deprecated
     

+ 2 - 9
app/Http/Controllers/Api/BaseApiController.php

@@ -310,15 +310,8 @@ class BaseApiController extends Controller
     {
         $user = $request->user();
         abort_if(!$user, 403);
-        $id = $user->id;
-
-        $res = Cache::remember('user:account:id:'.$id, now()->addHours(6), function() use($id) {
-            $profile = Profile::whereNull('status')->whereUserId($id)->firstOrFail();
-            $resource = new Fractal\Resource\Item($profile, new AccountTransformer());
-            $res = $this->fractal->createData($resource)->toArray();
-            return $res;
-        });
-
+        $resource = new Fractal\Resource\Item($user->profile, new AccountTransformer());
+        $res = $this->fractal->createData($resource)->toArray();
         return response()->json($res);
     }
 

+ 1 - 1
app/Http/Controllers/MediaController.php

@@ -48,7 +48,7 @@ class MediaController extends Controller
 		$path = $photo->storeAs($dir, $name);
         $res = [];
         $res['url'] =  URL::temporarySignedRoute(
-            'temp-media', now()->addHours(1), ['profileId' => $media->profile_id, 'mediaId' => $media->id]
+            'temp-media', now()->addHours(1), ['profileId' => $media->profile_id, 'mediaId' => $media->id, 'timestamp' => time()]
         );
         ImageOptimize::dispatch($media);
 		return $res;

+ 1 - 1
app/Services/StatusHashtagService.php

@@ -57,7 +57,7 @@ class StatusHashtagService {
 	public static function count($id)
 	{
 		$key = 'pf:services:status-hashtag:count:' . $id;
-		$ttl = now()->addHours(6);
+		$ttl = now()->addMinutes(5);
 		return Cache::remember($key, $ttl, function() use($id) {
 			return StatusHashtag::whereHashtagId($id)->count();
 		});

二进制
public/js/hashtag.js


二进制
public/mix-manifest.json


+ 1 - 0
resources/assets/js/components/Hashtag.vue

@@ -110,6 +110,7 @@
 		beforeMount() {
 			this.authenticated = $('body').hasClass('loggedIn');
 			this.getResults();
+			this.hashtagCount = window.App.util.format.count(this.hashtagCount);
 		},
 		methods: {
 			getResults() {