Skip to content

Commit d6cbc4d

Browse files
committed
feat: replace usage of picture-thumb format with picture-thumb-medium
1 parent 18c7f27 commit d6cbc4d

File tree

6 files changed

+11
-53
lines changed

6 files changed

+11
-53
lines changed

src/app/moder/pictures/item/item.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ <h1 i18n>Picture №{{ id }}</h1>
5959
}
6060
<div class="row mb-4">
6161
<div class="col-md-2">
62-
@if (picture.thumb) {
63-
<img alt="" [src]="picture.thumb.src" class="rounded border border-light w-100" />
62+
@if (picture.thumbMedium) {
63+
<img alt="" [src]="picture.thumbMedium.src" class="rounded border border-light w-100" />
6464
}
6565
</div>
6666
<div class="col-md-6">
@@ -536,7 +536,7 @@ <h3>Similar picture</h3>
536536
</p>
537537
<p>
538538
<a [routerLink]="['/moder/pictures', dfDistance.dstPictureId]">
539-
<img alt="" [src]="dfDistance.dstPicture?.thumb?.src" class="rounded border border-light" />
539+
<img alt="" [src]="dfDistance.dstPicture?.thumbMedium?.src" class="rounded border border-light" />
540540
</a>
541541
</p>
542542
<button (click)="cancelSimilar(dfDistance)" class="btn btn-warning">That is not similar</button>

src/app/moder/pictures/item/item.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export class ModerPicturesItemComponent {
135135
dfDistance: new DfDistanceRequest({
136136
fields: new DfDistanceFields({
137137
dstPicture: new PicturesRequest({
138-
fields: new PictureFields({thumb: true}),
138+
fields: new PictureFields({thumbMedium: true}),
139139
}),
140140
}),
141141
limit: 1,
@@ -170,7 +170,7 @@ export class ModerPicturesItemComponent {
170170
rights: true,
171171
siblings: new PicturesRequest({fields: new PictureFields({nameText: true})}),
172172
specialName: true,
173-
thumb: true,
173+
thumbMedium: true,
174174
views: true,
175175
}),
176176
language: this.#languageService.language,

src/app/styles.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,10 @@ img.avatar {
307307
.thumbnail-inline {
308308
display: inline-block;
309309
margin-bottom: 0;
310+
311+
img {
312+
max-width: 160px;
313+
}
310314
}
311315

312316
.nav-tree .nav .nav {

src/app/utils/user-text/user-text.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<a [routerLink]="['/picture', element.picture.identity]" class="thumbnail-inline">
1717
<img
1818
class="card-img-top"
19-
[src]="element.picture.thumb?.src"
19+
[src]="element.picture.thumbMedium?.src"
2020
[alt]="element.picture.nameText"
2121
[title]="element.picture.nameText"
2222
loading="lazy"

src/app/utils/user-text/user-text.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export class UserTextComponent {
202202
commentsCount: true,
203203
moderVote: true,
204204
nameText: true,
205-
thumb: true,
205+
thumbMedium: true,
206206
views: true,
207207
votes: true,
208208
});

src/grpc/spec.pb.ts

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -25174,7 +25174,6 @@ export class PictureFields implements GrpcMessage {
2517425174
_instance.votes = _instance.votes || false;
2517525175
_instance.commentsCount = _instance.commentsCount || false;
2517625176
_instance.moderVote = _instance.moderVote || false;
25177-
_instance.thumb = _instance.thumb || false;
2517825177
_instance.path = _instance.path || undefined;
2517925178
_instance.pictureItem = _instance.pictureItem || undefined;
2518025179
_instance.imageGalleryFull = _instance.imageGalleryFull || false;
@@ -25236,9 +25235,6 @@ export class PictureFields implements GrpcMessage {
2523625235
case 8:
2523725236
_instance.moderVote = _reader.readBool();
2523825237
break;
25239-
case 9:
25240-
_instance.thumb = _reader.readBool();
25241-
break;
2524225238
case 10:
2524325239
_instance.path = new PicturePathRequest();
2524425240
_reader.readMessage(
@@ -25368,9 +25364,6 @@ export class PictureFields implements GrpcMessage {
2536825364
if (_instance.moderVote) {
2536925365
_writer.writeBool(8, _instance.moderVote);
2537025366
}
25371-
if (_instance.thumb) {
25372-
_writer.writeBool(9, _instance.thumb);
25373-
}
2537425367
if (_instance.path) {
2537525368
_writer.writeMessage(
2537625369
10,
@@ -25467,7 +25460,6 @@ export class PictureFields implements GrpcMessage {
2546725460
private _votes: boolean;
2546825461
private _commentsCount: boolean;
2546925462
private _moderVote: boolean;
25470-
private _thumb: boolean;
2547125463
private _path?: PicturePathRequest;
2547225464
private _pictureItem?: PictureItemsRequest;
2547325465
private _imageGalleryFull: boolean;
@@ -25503,7 +25495,6 @@ export class PictureFields implements GrpcMessage {
2550325495
this.votes = _value.votes;
2550425496
this.commentsCount = _value.commentsCount;
2550525497
this.moderVote = _value.moderVote;
25506-
this.thumb = _value.thumb;
2550725498
this.path = _value.path ? new PicturePathRequest(_value.path) : undefined;
2550825499
this.pictureItem = _value.pictureItem
2550925500
? new PictureItemsRequest(_value.pictureItem)
@@ -25591,12 +25582,6 @@ export class PictureFields implements GrpcMessage {
2559125582
set moderVote(value: boolean) {
2559225583
this._moderVote = value;
2559325584
}
25594-
get thumb(): boolean {
25595-
return this._thumb;
25596-
}
25597-
set thumb(value: boolean) {
25598-
this._thumb = value;
25599-
}
2560025585
get path(): PicturePathRequest | undefined {
2560125586
return this._path;
2560225587
}
@@ -25736,7 +25721,6 @@ export class PictureFields implements GrpcMessage {
2573625721
votes: this.votes,
2573725722
commentsCount: this.commentsCount,
2573825723
moderVote: this.moderVote,
25739-
thumb: this.thumb,
2574025724
path: this.path ? this.path.toObject() : undefined,
2574125725
pictureItem: this.pictureItem ? this.pictureItem.toObject() : undefined,
2574225726
imageGalleryFull: this.imageGalleryFull,
@@ -25787,7 +25771,6 @@ export class PictureFields implements GrpcMessage {
2578725771
votes: this.votes,
2578825772
commentsCount: this.commentsCount,
2578925773
moderVote: this.moderVote,
25790-
thumb: this.thumb,
2579125774
path: this.path ? this.path.toProtobufJSON(options) : null,
2579225775
pictureItem: this.pictureItem
2579325776
? this.pictureItem.toProtobufJSON(options)
@@ -25832,7 +25815,6 @@ export module PictureFields {
2583225815
votes: boolean;
2583325816
commentsCount: boolean;
2583425817
moderVote: boolean;
25835-
thumb: boolean;
2583625818
path?: PicturePathRequest.AsObject;
2583725819
pictureItem?: PictureItemsRequest.AsObject;
2583825820
imageGalleryFull: boolean;
@@ -25867,7 +25849,6 @@ export module PictureFields {
2586725849
votes: boolean;
2586825850
commentsCount: boolean;
2586925851
moderVote: boolean;
25870-
thumb: boolean;
2587125852
path: PicturePathRequest.AsProtobufJSON | null;
2587225853
pictureItem: PictureItemsRequest.AsProtobufJSON | null;
2587325854
imageGalleryFull: boolean;
@@ -40421,7 +40402,6 @@ export class Picture implements GrpcMessage {
4042140402
_instance.commentsCountNew = _instance.commentsCountNew || 0;
4042240403
_instance.moderVoteVote = _instance.moderVoteVote || 0;
4042340404
_instance.moderVoteCount = _instance.moderVoteCount || 0;
40424-
_instance.thumb = _instance.thumb || undefined;
4042540405
_instance.path = _instance.path || [];
4042640406
_instance.pictureItems = _instance.pictureItems || undefined;
4042740407
_instance.imageGallery = _instance.imageGallery || undefined;
@@ -40547,13 +40527,6 @@ export class Picture implements GrpcMessage {
4054740527
case 21:
4054840528
_instance.moderVoteCount = _reader.readInt32();
4054940529
break;
40550-
case 22:
40551-
_instance.thumb = new APIImage();
40552-
_reader.readMessage(
40553-
_instance.thumb,
40554-
APIImage.deserializeBinaryFromReader
40555-
);
40556-
break;
4055740530
case 23:
4055840531
const messageInitializer23 = new PathTreePictureItem();
4055940532
_reader.readMessage(
@@ -40779,13 +40752,6 @@ export class Picture implements GrpcMessage {
4077940752
if (_instance.moderVoteCount) {
4078040753
_writer.writeInt32(21, _instance.moderVoteCount);
4078140754
}
40782-
if (_instance.thumb) {
40783-
_writer.writeMessage(
40784-
22,
40785-
_instance.thumb as any,
40786-
APIImage.serializeBinaryToWriter
40787-
);
40788-
}
4078940755
if (_instance.path && _instance.path.length) {
4079040756
_writer.writeRepeatedMessage(
4079140757
23,
@@ -40934,7 +40900,6 @@ export class Picture implements GrpcMessage {
4093440900
private _commentsCountNew: number;
4093540901
private _moderVoteVote: number;
4093640902
private _moderVoteCount: number;
40937-
private _thumb?: APIImage;
4093840903
private _path?: PathTreePictureItem[];
4093940904
private _pictureItems?: PictureItems;
4094040905
private _imageGallery?: APIImage;
@@ -40996,7 +40961,6 @@ export class Picture implements GrpcMessage {
4099640961
this.commentsCountNew = _value.commentsCountNew;
4099740962
this.moderVoteVote = _value.moderVoteVote;
4099840963
this.moderVoteCount = _value.moderVoteCount;
40999-
this.thumb = _value.thumb ? new APIImage(_value.thumb) : undefined;
4100040964
this.path = (_value.path || []).map(m => new PathTreePictureItem(m));
4100140965
this.pictureItems = _value.pictureItems
4100240966
? new PictureItems(_value.pictureItems)
@@ -41177,12 +41141,6 @@ export class Picture implements GrpcMessage {
4117741141
set moderVoteCount(value: number) {
4117841142
this._moderVoteCount = value;
4117941143
}
41180-
get thumb(): APIImage | undefined {
41181-
return this._thumb;
41182-
}
41183-
set thumb(value: APIImage | undefined) {
41184-
this._thumb = value;
41185-
}
4118641144
get path(): PathTreePictureItem[] | undefined {
4118741145
return this._path;
4118841146
}
@@ -41365,7 +41323,6 @@ export class Picture implements GrpcMessage {
4136541323
commentsCountNew: this.commentsCountNew,
4136641324
moderVoteVote: this.moderVoteVote,
4136741325
moderVoteCount: this.moderVoteCount,
41368-
thumb: this.thumb ? this.thumb.toObject() : undefined,
4136941326
path: (this.path || []).map(m => m.toObject()),
4137041327
pictureItems: this.pictureItems
4137141328
? this.pictureItems.toObject()
@@ -41449,7 +41406,6 @@ export class Picture implements GrpcMessage {
4144941406
commentsCountNew: this.commentsCountNew,
4145041407
moderVoteVote: this.moderVoteVote,
4145141408
moderVoteCount: this.moderVoteCount,
41452-
thumb: this.thumb ? this.thumb.toProtobufJSON(options) : null,
4145341409
path: (this.path || []).map(m => m.toProtobufJSON(options)),
4145441410
pictureItems: this.pictureItems
4145541411
? this.pictureItems.toProtobufJSON(options)
@@ -41518,7 +41474,6 @@ export module Picture {
4151841474
commentsCountNew: number;
4151941475
moderVoteVote: number;
4152041476
moderVoteCount: number;
41521-
thumb?: APIImage.AsObject;
4152241477
path?: PathTreePictureItem.AsObject[];
4152341478
pictureItems?: PictureItems.AsObject;
4152441479
imageGallery?: APIImage.AsObject;
@@ -41571,7 +41526,6 @@ export module Picture {
4157141526
commentsCountNew: number;
4157241527
moderVoteVote: number;
4157341528
moderVoteCount: number;
41574-
thumb: APIImage.AsProtobufJSON | null;
4157541529
path: PathTreePictureItem.AsProtobufJSON[] | null;
4157641530
pictureItems: PictureItems.AsProtobufJSON | null;
4157741531
imageGallery: APIImage.AsProtobufJSON | null;

0 commit comments

Comments
 (0)