@glissandoo/lib 1.10.0 → 1.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,6 +24,7 @@ export declare enum AppScenes {
24
24
  EditProfilePhotoURL = "EditProfilePhotoURL",
25
25
  EditProfileDescription = "EditProfileDescription",
26
26
  EditProfileLanguage = "EditProfileLanguage",
27
+ EditProfileNotifications = "EditProfileNotifications",
27
28
  CommunicationList = "communications",
28
29
  CommunicationNewComment = "communicationNewComment",
29
30
  Communication = "communication",
@@ -28,6 +28,7 @@ var AppScenes;
28
28
  AppScenes["EditProfilePhotoURL"] = "EditProfilePhotoURL";
29
29
  AppScenes["EditProfileDescription"] = "EditProfileDescription";
30
30
  AppScenes["EditProfileLanguage"] = "EditProfileLanguage";
31
+ AppScenes["EditProfileNotifications"] = "EditProfileNotifications";
31
32
  AppScenes["CommunicationList"] = "communications";
32
33
  AppScenes["CommunicationNewComment"] = "communicationNewComment";
33
34
  AppScenes["Communication"] = "communication";
@@ -15,6 +15,9 @@ export default class GroupRepertory extends Theme<GroupRepertoryData> {
15
15
  pages: number[];
16
16
  }[];
17
17
  get mainFilePath(): string | null;
18
+ get votes(): Record<string, number>;
19
+ voteByUserId(userId: string): number | null;
20
+ get rating(): number;
18
21
  get events(): string[];
19
22
  get eventsTL(): Record<string, import("../../Evento/types").EventTinyData>;
20
23
  get eventsList(): EventoTiny[];
@@ -29,6 +29,19 @@ class GroupRepertory extends basic_1.default {
29
29
  get mainFilePath() {
30
30
  return this.data.mainFilePath;
31
31
  }
32
+ get votes() {
33
+ return this.data.votes || {};
34
+ }
35
+ voteByUserId(userId) {
36
+ return this.votes[userId] || null;
37
+ }
38
+ get rating() {
39
+ const numberVotes = Object.keys(this.votes).length;
40
+ const totalVotes = Object.entries(this.votes).reduce((acc, [, value]) => acc + value, 0);
41
+ if (numberVotes === 0 || totalVotes === 0)
42
+ return 0;
43
+ return Math.round((numberVotes / totalVotes) * 100) / 100;
44
+ }
32
45
  get events() {
33
46
  return this.data.events || [];
34
47
  }
@@ -31,6 +31,7 @@ export interface GroupRepertoryData extends ThemeBasicData {
31
31
  mainFilePath: string | null;
32
32
  scoresByInstruments: boolean;
33
33
  instruments: GroupRepertoryInstrumentItemData[];
34
+ votes: Record<string, number>;
34
35
  audios: string[];
35
36
  thumbnailURL: string | null;
36
37
  identifyAt: Timestamp | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissandoo/lib",
3
- "version": "1.10.0",
3
+ "version": "1.10.1",
4
4
  "description": "Glissandoo library js",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",