File Mode Play Random Using Yatse Duplicates Some Songs
#31
Great, now we are getting somewhere!!!
I can see why having the music files in both music and video databases would cause processing for JSON calls to produce duplicated items on the queue, and why it happens on the Pi that is also the MariaDB server but not on the other Pi (which shares the  same served video db) because of path differences of the music file locations. Fixing is not trivial so less likely to get into v19 because of the risk of breaking other things, but understanding is a huge step forwards.

What I can't see is how those music files ended up as entries in the files table pf the video databse in the first place. I have tried to reproduce it for testing and so far not managed to get music files in the video database. Any ideas what you could have done? No worries if not, but it would help to know.
Reply
#32
Do you have any suggestions of some settings / library files that I could look at that may contain an error?
I have a 2021 folder that doesn't cause duplicates.
Before I got the usb drive for pi number 1, I was accessing the Music on the other pi using upnp
I made playlists of all the YEAR folders on pi number 2 that I also accessed through upnp
There are other folders that cause duplicates that aren't added to playlists though.
I noticed the MyVideos107.db in userdata/database folder was last changed Nov 2018 which is when I set MariaDB up and that also found some music in video database.

I used this guide (3 years ago) to set MariaDB up and you can see my posts further down of having trouble getting music library to be shared, I gave up in the end.
https://discourse.osmc.tv/t/wiki-install...ents/19170
Reply
#33
Had a quick look at that post and it seems you got confused about using a shared server for database with sharing the actual media files from one device to the other

Mostly because I know little about it, I suspect that it could have something to do with playing files located on SD card of Pi-2 with Kodi on Pi-1 via upnp. Perhaps you can test that since you have the devices set up, play a music file that does not have an entry in the files table yet.

Alternatively have you ever changed advancedsettings.xml so that .mp3 files get played as video and can be scanned into the video library? I doubt it, log shows it is not currently doing so, but users can do odd things at times and keep secrets so it is always good to ask.
Reply
#34
I played 2 songs through upnp that weren't in the video database and in yatse it just says Lounge (doesn't display song name when playing)
I checked database after letting them play to the end but they haven't been added to the video database Sad

I'm pretty sure I copied and pasted the advancedsetting.xml code from that guide which includes <musicdatabase> but after not getting music share to work I must of deleted that part as it only contains the video database part now. I may have done something wrong when deleting it i don't know (maybe left part of the music code in?) then corrected it later?
I haven't changed it since I set it up 3 years ago though and some music added last year have made it into the video database.

I remember the video library stopped syncing on pi number 1 after I updated osmc to V18 a year or so ago, I then updated pi number 2 and I think I had to rescan the whole library again as I remember loosing all the "watched" statuses.
Reply
#35
I've just got songs to duplicate in the 2021 folder!
I tried something I was doing quite often but haven't for a while.
In Yatse I connected to pi Number 2 (Lounge) then I pressed the cast button and chose Media Centers / Bedroom (pi number 1) then went to files / music / 2021 and I can't remember if I chose play all or play random, I let 4 songs play (skipped them to the end) then stopped the audio.
I then turned off cast and went to files / music / 2021 play random and 4 songs are now duplicated!

I stopped using that method because the music would randomly stop before playing all the music in the playlist, yatse developer said my phone was disconnecting which caused the music to stop and playlist disappeared. That way doesn't create a playlist on kodi only on phone so if phone disconnects the music stops.

Edit: Just tried it on pi number 1 casting to number 2 and it's also duplicated the songs! Big Grin
Reply
#36
OK, want more details. Can you make a Kodi debug log (JSON component logging enballed as before) while using Yatse to cast playback from one Pi to the other.
Reply
#37
Ok I turned on logging on both pi's then rebooted and connected to Number 2 in Yatse and casted to Number 1 and played 3 songs in 2017 folder using play random (skipping to near the end of song so it played the next)
At first I just did play random by mistake so stopped playback then hit the cast button.
Number 2 log
https://www.dropbox.com/s/4y1s034ysvamc1...i.log?dl=0
Number 1 log
https://www.dropbox.com/s/iewgxernnx9ys1...i.log?dl=0

I skipped to the end of 2 songs and stopped playback when 3rd one started, all 3 songs are now in video database.
Reply
#38
Good, now I have the bug pinned down, can reproduce it and will fix in due course. Thank you @mazerti for proving the logs and patiently doing all the investigation I requested.

As I said before because of risk in making changes to this area the fix my not get backported so will only be in v20. That is probably a fair way off for you as a user, so in the meanwhile as a workaround while using v18 you could either avoid using file mode (I have a life mission to encourage users to make use of the extensive music library features to filter and explore their music collection, and will add that Yatse has great music library filtering features too), or  go into your video database and delete any music files from the files table.
Reply
#39
No problem it was fun trying to find how it was happening lol
So if I use that query you gave me to find the music entries I can just select them all and press delete?
Thanks.
Reply
#40
Yes, I think Heidi supports that when it shows query results. If not then use this SQL
Code:
DELETE FROM files WHERE strFilename LIKE '%.mp3' OR strFilename LIKE '%.flac';
Reply

Logout Mark Read Team Forum Stats Members Help
File Mode Play Random Using Yatse Duplicates Some Songs0