Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Essem
Sharkey
Commits
7ed2a5fc
Commit
7ed2a5fc
authored
1 year ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
perf(backend): remove needless query
#12206
parent
5fb68474
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
packages/backend/src/core/entities/ChannelEntityService.ts
+2
-13
2 additions, 13 deletions
packages/backend/src/core/entities/ChannelEntityService.ts
with
3 additions
and
13 deletions
CHANGELOG.md
+
1
−
0
View file @
7ed2a5fc
...
...
@@ -54,6 +54,7 @@
-
Enhance: フォローしているチャンネルをフォロー解除した時(またはその逆)、タイムラインに反映される間隔を改善
-
Enhance: プロフィールの自己紹介欄のMFMが連合するようになりました
-
相手がMisskey v2023.11.0以降である必要があります
-
Enhance: チャンネル取得時のパフォーマンスを向上
-
Fix: リストTLに自分のフォロワー限定投稿が含まれない問題を修正
-
Fix: ローカルタイムラインに投稿者自身の投稿への返信が含まれない問題を修正
-
Fix: 自分のフォローしているユーザーの自分のフォローしていないユーザーの visibility: followers な投稿への返信がストリーミングで流れてくる問題を修正
...
...
This diff is collapsed.
Click to expand it.
packages/backend/src/core/entities/ChannelEntityService.ts
+
2
−
13
View file @
7ed2a5fc
...
...
@@ -5,7 +5,7 @@
import
{
Inject
,
Injectable
}
from
'
@nestjs/common
'
;
import
{
DI
}
from
'
@/di-symbols.js
'
;
import
type
{
ChannelFavoritesRepository
,
ChannelFollowingsRepository
,
ChannelsRepository
,
DriveFilesRepository
,
NoteUnreadsRepository
,
NotesRepository
}
from
'
@/models/_.js
'
;
import
type
{
ChannelFavoritesRepository
,
ChannelFollowingsRepository
,
ChannelsRepository
,
DriveFilesRepository
,
NotesRepository
}
from
'
@/models/_.js
'
;
import
type
{
Packed
}
from
'
@/misc/json-schema.js
'
;
import
type
{
}
from
'
@/models/Blocking.js
'
;
import
type
{
MiUser
}
from
'
@/models/User.js
'
;
...
...
@@ -14,7 +14,6 @@ import { bindThis } from '@/decorators.js';
import
{
IdService
}
from
'
@/core/IdService.js
'
;
import
{
DriveFileEntityService
}
from
'
./DriveFileEntityService.js
'
;
import
{
NoteEntityService
}
from
'
./NoteEntityService.js
'
;
import
{
In
}
from
'
typeorm
'
;
@
Injectable
()
export
class
ChannelEntityService
{
...
...
@@ -31,9 +30,6 @@ export class ChannelEntityService {
@
Inject
(
DI
.
notesRepository
)
private
notesRepository
:
NotesRepository
,
@
Inject
(
DI
.
noteUnreadsRepository
)
private
noteUnreadsRepository
:
NoteUnreadsRepository
,
@
Inject
(
DI
.
driveFilesRepository
)
private
driveFilesRepository
:
DriveFilesRepository
,
...
...
@@ -54,13 +50,6 @@ export class ChannelEntityService {
const
banner
=
channel
.
bannerId
?
await
this
.
driveFilesRepository
.
findOneBy
({
id
:
channel
.
bannerId
})
:
null
;
const
hasUnreadNote
=
meId
?
await
this
.
noteUnreadsRepository
.
exist
({
where
:
{
noteChannelId
:
channel
.
id
,
userId
:
meId
,
},
})
:
undefined
;
const
isFollowing
=
meId
?
await
this
.
channelFollowingsRepository
.
exist
({
where
:
{
followerId
:
meId
,
...
...
@@ -99,7 +88,7 @@ export class ChannelEntityService {
...(
me
?
{
isFollowing
,
isFavorited
,
hasUnreadNote
,
hasUnreadNote
:
false
,
// 後方互換性のため
}
:
{}),
...(
detailed
?
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment