Skip to content

Commit 526e3b1

Browse files
committed
update
1 parent 66bb138 commit 526e3b1

9 files changed

Lines changed: 345 additions & 58 deletions

File tree

documentation/components/MusicComponent.html

Lines changed: 300 additions & 29 deletions
Large diffs are not rendered by default.

documentation/coverage.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@
553553
<td>MusicComponent</td>
554554
<td align="right" data-sort="100">
555555
<span class="coverage-percent">100 %</span>
556-
<span class="coverage-count">(19/19)</span>
556+
<span class="coverage-count">(23/23)</span>
557557
</td>
558558
</tr>
559559
<tr class="very-good">

documentation/injectables/SaavnService.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,8 @@ <h3 id="methods">
305305

306306
<tr>
307307
<td class="col-md-4">
308-
<div class="io-line">Defined in <a href="" data-line="151"
309-
class="link-to-prism">src/app/service/saavan-api/saavan.service.ts:151</a></div>
308+
<div class="io-line">Defined in <a href="" data-line="153"
309+
class="link-to-prism">src/app/service/saavan-api/saavan.service.ts:153</a></div>
310310
</td>
311311
</tr>
312312

@@ -713,20 +713,22 @@ <h3 id="inputs">
713713
You are a smart music recommendation assistant. Your job is to analyze the mood and style of the current song the user is listening to and suggest the most accurate next song that fits or enhances the user&#x27;s mood and listening experience.
714714

715715
Given the current song details:
716-
${formatField(&#x27;Name&#x27;, currentSong.name)}${formatField(&#x27;Type&#x27;, currentSong.type)}${formatField(&#x27;Year&#x27;, currentSong.year)}${formatField(&#x27;Duration&#x27;, currentSong.duration)}${formatField(&#x27;Label&#x27;, currentSong.label)}${formatField(&#x27;Language&#x27;, currentSong.language)}${formatField(&#x27;Copyright&#x27;, currentSong.copyright)}${formatField(&#x27;Album Name&#x27;, albumName)}${formatField(&#x27;Artist Name&#x27;, artistsName)}
716+
${formatField(&#x27;Name&#x27;, currentSong.name)}${formatField(&#x27;Type&#x27;, currentSong.type)}${formatField(&#x27;Year&#x27;, currentSong.year)}${formatField(&#x27;Duration&#x27;, currentSong.duration)}${formatField(&#x27;Label&#x27;, currentSong.label)}${formatField(&#x27;Language&#x27;, currentSong.language)}${formatField(&#x27;Copyright&#x27;, currentSong.copyright)}${formatField(&#x27;Album Name&#x27;, albumName)}${formatField(&#x27;Artist Name&#x27;, artistsName)}${formatField(&#x27;Is User Liked&#x27;, currentSong.isLiked)}
717717

718718
🎯 Responsibilities:
719-
- Analyze the mood and style of the current song based on the given details(name, album name, language, artist, year, etc.).
719+
- Analyze the mood and style of the current song based on the given details (name, album name, language, artist, year, etc.).
720+
- Consider whether the user liked the song or not to suggest the next song accordingly. If the user liked the song, recommend something similar or enhancing the mood; if not, suggest a song that may better fit the user&#x27;s preferences.
720721
- Suggest the next song that is the most accurate match in mood, vibe, and style to provide a smooth and positive user experience.
721722
- Use only the current song’s metadata to infer the best next song.
722723
- Do not include any additional text, explanation, or formatting in your response.
723724
- Do not repeat the already suggested song.
724725

725-
Provide only the JSON object and no extra text, no backticks, no markdown formatting:
726+
Provide only the JSON object and no extra text, no formatting:
726727
{
727728
&quot;songName&quot;: &quot;string&quot;,
728729
&quot;artistsName&quot;: &quot;string&quot;
729730
}
731+
730732
&#x60;;
731733

732734
this.history.push({ role: &#x27;user&#x27;, parts: [{ text: prompt }] });

documentation/interfaces/ChatMessage.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,20 +384,22 @@ <h3 id="inputs">Properties</h3>
384384
You are a smart music recommendation assistant. Your job is to analyze the mood and style of the current song the user is listening to and suggest the most accurate next song that fits or enhances the user&#x27;s mood and listening experience.
385385

386386
Given the current song details:
387-
${formatField(&#x27;Name&#x27;, currentSong.name)}${formatField(&#x27;Type&#x27;, currentSong.type)}${formatField(&#x27;Year&#x27;, currentSong.year)}${formatField(&#x27;Duration&#x27;, currentSong.duration)}${formatField(&#x27;Label&#x27;, currentSong.label)}${formatField(&#x27;Language&#x27;, currentSong.language)}${formatField(&#x27;Copyright&#x27;, currentSong.copyright)}${formatField(&#x27;Album Name&#x27;, albumName)}${formatField(&#x27;Artist Name&#x27;, artistsName)}
387+
${formatField(&#x27;Name&#x27;, currentSong.name)}${formatField(&#x27;Type&#x27;, currentSong.type)}${formatField(&#x27;Year&#x27;, currentSong.year)}${formatField(&#x27;Duration&#x27;, currentSong.duration)}${formatField(&#x27;Label&#x27;, currentSong.label)}${formatField(&#x27;Language&#x27;, currentSong.language)}${formatField(&#x27;Copyright&#x27;, currentSong.copyright)}${formatField(&#x27;Album Name&#x27;, albumName)}${formatField(&#x27;Artist Name&#x27;, artistsName)}${formatField(&#x27;Is User Liked&#x27;, currentSong.isLiked)}
388388

389389
🎯 Responsibilities:
390-
- Analyze the mood and style of the current song based on the given details(name, album name, language, artist, year, etc.).
390+
- Analyze the mood and style of the current song based on the given details (name, album name, language, artist, year, etc.).
391+
- Consider whether the user liked the song or not to suggest the next song accordingly. If the user liked the song, recommend something similar or enhancing the mood; if not, suggest a song that may better fit the user&#x27;s preferences.
391392
- Suggest the next song that is the most accurate match in mood, vibe, and style to provide a smooth and positive user experience.
392393
- Use only the current song’s metadata to infer the best next song.
393394
- Do not include any additional text, explanation, or formatting in your response.
394395
- Do not repeat the already suggested song.
395396

396-
Provide only the JSON object and no extra text, no backticks, no markdown formatting:
397+
Provide only the JSON object and no extra text, no formatting:
397398
{
398399
&quot;songName&quot;: &quot;string&quot;,
399400
&quot;artistsName&quot;: &quot;string&quot;
400401
}
402+
401403
&#x60;;
402404

403405
this.history.push({ role: &#x27;user&#x27;, parts: [{ text: prompt }] });

documentation/js/search/search_index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

documentation/miscellaneous/variables.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,8 +688,11 @@ <h3></h3> <table class="table table-sm table-bordered">
688688
<td class="col-md-4">
689689
<i>Default value : </i><code>{
690690

691-
/** Name of the application. */
691+
/**
692+
* Name of the application.
693+
*/
692694
appName: &#x27;ExpenseWise&#x27;,
695+
693696
/**
694697
* Flag to indicate if the app is running in production mode.
695698
* Set to true in the production environment.
@@ -714,7 +717,7 @@ <h3></h3> <table class="table table-sm table-bordered">
714717
* Application version.
715718
* This should be updated with each release to track application versions.
716719
*/
717-
applicationVersion: &#x27;25.9.13&#x27;, // Current application version
720+
applicationVersion: &#x27;25.9.21&#x27;, // Current application version
718721

719722
/**
720723
* The production (live) API base URL.

src/app/features/music/music.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,17 @@
7575
</button>
7676

7777
<!-- Like Button -->
78-
<button (click)="toggleLike(currentSong)"
78+
<button (click)="toggleLike()"
7979
class="w-8 h-8 flex items-center justify-center rounded-full hover:bg-[var(--list-hover)] active:scale-90 transition-transform">
8080
<img
81-
[src]="isLiked(currentSong) ? 'assets/img/music_icon/icons8-love-fill-48.png' : 'assets/img/music_icon/icons8-love-48.png'"
81+
[src]="isLiked() ? 'assets/img/music_icon/icons8-love-fill-48.png' : 'assets/img/music_icon/icons8-love-48.png'"
8282
alt="Like" class="w-6 h-6 object-contain transition-transform duration-300 ease-in-out"
83-
style="filter: var(--icon-color2);" />
83+
[style]="isLiked() ? 'filter: var(--icon-color1);' : 'filter: var(--icon-color2);'" />
8484
</button>
8585

8686
<button (click)="downloadSong(currentSong)"
8787
class="w-8 h-8 flex items-center justify-center rounded-full hover:bg-[var(--list-hover)] active:scale-90 transition-transform">
88-
<img src="assets/img/music_icon/icons8-download-48.png" alt="Download"
88+
<img src="assets/img/music_icon/icons8-download-48.png" alt="Download"
8989
class="w-6 h-6 object-contain transition-transform duration-300 ease-in-out"
9090
style="filter: var(--icon-color2);" />
9191
</button>

src/app/features/music/music.component.ts

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ export class MusicComponent implements OnDestroy {
224224
}
225225

226226
/** Toggles the like status of a song */
227-
toggleLike(song: any) {
227+
toggleLike() {
228228
if (this.isCurrentSongLiked) {
229229
this.isCurrentSongLiked = false;
230230
} else {
@@ -233,20 +233,29 @@ export class MusicComponent implements OnDestroy {
233233
}
234234

235235
/** Checks if a song is liked */
236-
isLiked(song: any): boolean {
236+
isLiked(): boolean {
237237
return this.isCurrentSongLiked;
238238
}
239239

240-
downloadSong(song: any) {
240+
/** Downloads a song */
241+
async downloadSong(song: any) {
241242
if (!song?.url) return;
242243

243-
const link = document.createElement('a');
244-
link.href = song.url;
245-
link.download = `${song.name}.mp3`;
246-
document.body.appendChild(link);
247-
link.click();
248-
document.body.removeChild(link);
244+
try {
245+
const res = await fetch(song.url);
246+
if (!res.ok) throw new Error('Failed to fetch song');
247+
248+
const blob = await res.blob(); // Convert response to Blob
249+
const link = document.createElement('a');
250+
link.href = URL.createObjectURL(blob);
251+
link.download = `${song.name || 'song'}.mp3`;
252+
document.body.appendChild(link);
253+
link.click();
254+
document.body.removeChild(link);
255+
URL.revokeObjectURL(link.href);
256+
257+
} catch (err) {
258+
console.error('Download failed:', err);
259+
}
249260
}
250-
251-
252261
}

src/environments/environments.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const environment = {
3333
* Application version.
3434
* This should be updated with each release to track application versions.
3535
*/
36-
applicationVersion: '25.9.13', // Current application version
36+
applicationVersion: '25.9.21', // Current application version
3737

3838
/**
3939
* The production (live) API base URL.

0 commit comments

Comments
 (0)