Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


my moOde Addons-Collection
#11
(12-16-2024, 04:59 PM)Stephanowicz Wrote:
(12-16-2024, 11:40 AM)Subsub Wrote: Hi Stephan, update suggestion for Song Lyrics (if you have the inclination and time obviously  Smile). LRCGET (another great  github application) scans for and embeds locally song lyrics alongside songs it identifies. Is there any way your Song Lyric addon  could be updated to scan our media directories for these lrc files and output them. If none found then the addon invokes genius.com and gets the lyrics from there as before?
.

Hi,  
  
thank You :Smile 
  
I just added a fix as they have changed their code a little bit... this happens from time to time.  
  

Regarding LRCGET: I have forgotten to mention that the script already scans the folder for ".txt" files and displays them first before querying genius.  
So, as what I've seen quickly reading the LRCGET description, they also put a file with lyrics in the song folder?
If so it shouldn't be a big thing to add the file extension they use to the script!  
   
Could post an excerpt of such a file, please?  

   
Cheers, Stephan
Fantastic- all working now. Your skill and help is greatly appreciated. Cheers

Note :
LRCGET will scan every file in your chosen directory for music files and try to download lyrics to a LRC file having the exact same name and save them to the same directory as your music files.
The content of such a file eg "101-amy_winehouse-intro_-_stronger_than_me.lrc"  is as follows

[00:27.44] You should be Stronger Than Me

[00:32.57] You been here seven years longer than me
[00:37.97] Don't you know you supposed to be the man
[00:42.89] Not pale in comparison to who you think I am
[00:47.63] You always wanna talk it through, I don't care!
[00:52.98] I always have to comfort you when I'm there
[00:57.88] But that's what I need you to do, stroke my hair!
[01:04.16] 'Cause I've forgotten all of young love's joy
[01:09.74] Feel like a lady, and you my lady boy
[01:14.63] You should be Stronger Than Me
[01:19.84] But instead you're longer than frozen turkey
[01:25.17] Why'd you always put me in control?
[01:30.15] All I need is for my man to live up to his role
[01:34.99] Always wanna talk it through, I'm ok
[01:39.89] Always have to comfort you every day
[01:45.24] But that's what I need you to do, are you gay?
[01:51.37] 'Cause I've forgotten all of young love's joy
[01:57.11] Feel like a lady, and you my lady boy
[02:01.78] He said "The respect I made you earn
[02:06.79] Thought you had so many lessons to learn"
[02:11.62] I said "You don't know what love is, get a grip!"
[02:17.57] Sounds as if you're reading from some other tired script
[02:22.31] I'm not gonna meet your mother anytime
[02:27.55] I just wanna grip your body over mine
[02:33.24] Please, tell me why you think that's a crime
[02:38.65] I've forgotten all of young love's joy
[02:44.58] Feel like a lady, and you my lady boy
[02:49.27] You should be Stronger Than Me
[02:54.64] You should be Stronger Than Me
[02:59.97] You should be Stronger Than Me
[03:04.98] You should be Stronger Than Me
[03:07.81] 
Reply
#12
Ok,

I think I got it working Smile 

You can use this file for testing: https://github.com/Stephanowicz/moOde-au...sLocal.php

The formatting is not nice - or better said: there is no formatting  Big Grin 

I wonder if one can adjust how the lirc-files look like - in Your example the songpositions are integrated, which is interesting for displaying the verses according to the current song position - but not so much for just viewing, as they also don't have any formatting like paragraphs.

Would be nice if You could test it and give feedback!

Cheers, Stephan

   
PS: by testing I also found a bug I didn't notice, yet  Big Grin

PPS: mistakenly used ".lirc" instead of ".lrc" as extension - corrected it now
Reply
#13
(12-17-2024, 05:25 PM)Stephanowicz Wrote: Ok,

I think I got it working Smile 

You can use this file for testing: https://github.com/Stephanowicz/moOde-au...sLocal.php

The formatting is not nice - or better said: there is no formatting  Big Grin 

I wonder if one can adjust how the lirc-files look like - in Your example the songpositions are integrated, which is interesting for displaying the verses according to the current song position - but not so much for just viewing, as they also don't have any formatting like paragraphs.

Would be nice if You could test it and give feedback!

Cheers, Stephan

   
PS: by testing I also found a bug I didn't notice, yet  Big Grin

PPS: mistakenly used ".lirc" instead of ".lrc" as extension - corrected it now

Hi Stephan, the change works well. The only inconsistency is that the lyrics displayed for any song with a local .lrc file displays the lyrics with the adjacent 'timecode' eg it displays "[02:33.24] Please, tell me why you think that's a crime" and not "Please, tell me why you think that's a crime". Apart from that it is consistent across the board. Thanks for your time on this. 
Reply
#14
(12-20-2024, 03:55 PM)Subsub Wrote: Hi Stephan, the change works well. The only inconsistency is that the lyrics displayed for any song with a local .lrc file displays the lyrics with the adjacent 'timecode' eg it displays "[02:33.24] Please, tell me why you think that's a crime" and not "Please, tell me why you think that's a crime". Apart from that it is consistent across the board. Thanks for your time on this. 

Hi, it took a while till I understood - I thought You asked me why I think it's a crime xDD  
Well, it's not a crime, just again my mistake with ".lirc" 

You can simply correct it in line 44:  
Code:
if($info['extension']=="lirc"){ 

just replace the "lirc" with "lrc"

or download the file - I just corrected it.  (https://github.com/Stephanowicz/moOde-au...sLocal.php)


Cheers, Stephan
Reply
#15
UPDATE:

The fix I made for finding the filename in the title is not truely correct - one needs to check in both directions, as the filename could be longer than the title (like with "lirc" files) and the other way - the filename is shorter as the Title (or same lenth) - which should be the normal case.

So again a (hopefully last) fix :  (https://github.com/Stephanowicz/moOde-au...sLocal.php)

Also corrected code to check "argv" correctly

Cheers, Stephan


PS: will try to integrate the lrc-webapi and als extend the settings page to enable lyrics for local files only
Reply
#16
(12-21-2024, 10:21 AM)Stephanowicz Wrote: UPDATE:

The fix I made for finding the filename in the title is not truely correct - one needs to check in both directions, as the filename could be longer than the title (like with "lirc" files) and the other way - the filename is shorter as the Title (or same lenth) - which should be the normal case.

So again a (hopefully last) fix :  (https://github.com/Stephanowicz/moOde-au...sLocal.php)

Also corrected code to check "argv" correctly

Cheers, Stephan


PS: will try to integrate the lrc-webapi and als extend the settings page to enable lyrics for local files only

From a pure developer's point of view, I would entirely ignore the music file metadata; and ONLY search for an exact filename match, the extension being ".lrc" or ".lirc".
Reply
#17
(12-21-2024, 01:51 PM)Nutul Wrote: From a pure developer's point of view, I would entirely ignore the music file metadata; and ONLY search for an exact filename match, the extension being ".lrc" or ".lirc".

Not sure if I got You right - are You talking about "Artist" and "Title" when speaking of "music file metadata" ?

Well, I think this data should be more reliable than the name of the musicfile...
Reply
#18
UPDATE v1.0.13 Releases · Stephanowicz/moOde-audioplayer-addons

Added support for the LRCLIB Lyrics-API (https://lrclib.net/)

Also it is now possible to enable the songlyrics option without meeting the requirements for the web-api queries - in case You have local .txt or .lrc lyric-files.

Cheers,

Stephan
Reply
#19
(12-21-2024, 06:18 PM)Stephanowicz Wrote:
(12-21-2024, 01:51 PM)Nutul Wrote: From a pure developer's point of view, I would entirely ignore the music file metadata; and ONLY search for an exact filename match, the extension being ".lrc" or ".lirc".

Not sure if I got You right - are You talking about "Artist" and "Title" when speaking of "music file metadata" ?

Well, I think this data should be more reliable than the name of the musicfile...

Of course the metadata info is expected to be more correct/complete of a filename composed with it.

But I meant: if the lyrics are on an external file, you should look for a file with the same name as the music one, and extension ".lrc", like:
Eagles - Hotel California.flac
Eagles - Hotel California.lrc

which is basically the same as aaa.flac + aaa.lrc, no matter what track of what album of what artist the aaa.flac file is...
Reply
#20
(12-21-2024, 06:59 PM)Nutul Wrote:
(12-21-2024, 06:18 PM)Stephanowicz Wrote:
(12-21-2024, 01:51 PM)Nutul Wrote: From a pure developer's point of view, I would entirely ignore the music file metadata; and ONLY search for an exact filename match, the extension being ".lrc" or ".lirc".

Not sure if I got You right - are You talking about "Artist" and "Title" when speaking of "music file metadata" ?

Well, I think this data should be more reliable than the name of the musicfile...

Of course the metadata info is expected to be more correct/complete of a filename composed with it.

But I meant: if the lyrics are on an external file, you should look for a file with the same name as the music one, and extension ".lrc", like:
Eagles - Hotel California.flac
Eagles - Hotel California.lrc

which is basically the same as aaa.flac + aaa.lrc, no matter what track of what album of what artist the aaa.flac file is...

Yes, if the files (both music and lyrics) are named like that... Big Grin
In the case of the .lrc file that subsub provided it's "101-amy_winehouse-intro_-_stronger_than_me.lrc" - so one can not expect that the files are named "properly". 
But I think the php "stripos" function is sufficiant in most cases.

Cheers, Stephan
Reply


Forum Jump: