Jump to content

Emby not always updating in Kodi


heula
Go to solution Solved by Angelblue05,

Recommended Posts

alturismo

@@alturismo

 

Can you repair your libraries with 4.0.23 and let me know if your scenario is resolved? Thanks.

 

Hi, i ll reset Databases and report back ;)

Link to comment
Share on other sites

popy

@Angelblue05: Just want to let you know i added some more stuf and emby for kodi v4.0.21a is working "stable" at least for me.

 

pOpY

  • Like 1
Link to comment
Share on other sites

alturismo

@@alturismo

 

Can you repair your libraries with 4.0.23 and let me know if your scenario is resolved? Thanks.

 

first real test and sadly same issue here, attached 2 screens from 1 episode (see length in buttom, 53 mis is the .ts version wich shouldnt be there anymore)

 

2 screens and log attached

post-112497-0-13568500-1558038925_thumb.png

post-112497-0-45492300-1558038934_thumb.png

kodi.log

Link to comment
Share on other sites

alturismo

well, i did just reset database and then it synced the content, but i check my other shields wich where updated and resetted today morning, i report back

Link to comment
Share on other sites

Angelblue05

Was the ts added during the initial sync?

 

When time came to remove the ts entry it said the entry didn't exist in database so how can it be in Kodi?

Link to comment
Share on other sites

Angelblue05

Ok I checked your log.

 

First Delilah added during the initial sync: 391964

When replaced, Emby sent 391963 to remove and added 391969.

 

Where does that 391963 come from...

 

I will have to retest your scenario. If I update library every step of the way you described in your other post, everything works correctly here.

 

@@alturismo

 

When you remove the ts. Do you remove the season folder? or the episode itself?

Edited by Angelblue05
Link to comment
Share on other sites

alturismo

@@alturismo

 

When you remove the ts. Do you remove the season folder? or the episode itself?

 

as soon as its empty i remove both.

 

scenario in easy (without series name now)

 

1. episode.ts in /season 2

2. avidemux read /season 2/episode.ts, extra file is now there /season 2/episode.idx2 (shouldnt bother)

3. cut and remux, now 3rd file is created /season 2/episode.mkv

4. moving episode to proper folder /season 02/episode.mkv

5. removing /season 2/episode.idx2, removing /season 2/episode.ts, removing /season 2 (when empty, possible another record running)

6. updating library by api call

 

besides step 3 its all automated by a self written script, just the cut and remux is manual as i had no good results with comskip etc

 

so for emby the same episode existed 3 times (with 2 physical files) after moving from 1 digit season folder to 2 digit ...

it existed 2 times when its already a 2 digit season number, sample /season 11

 

/season 2/episode.ts  <- removed

/season 2/episode.mkv  <- moved

/season 02/episode.mkv

Link to comment
Share on other sites

Angelblue05

In your last log that you provided, was the season folder removed. Thanks. I have not tested that, I've only tested removing the .ts file and it was correct in Kodi. But I'm trying to understand what Emby was trying to remove in your log, because it wasn't the episode file - it had a different id.

Edited by Angelblue05
Link to comment
Share on other sites

alturismo

ok, here as workflow my script, its self written so ;) so you can follow the workflow in case it matters, keys, token, pass replaced

 

---

#!/bin/bash
 
startpath="/mnt/cache/Media/" ### main place where to look for
searchpattern="*.ts" ### what type of files to look for
matchpattern=".mkv" ### compare if exist - work done ?
extradelpattern=".idx2" ### extra delete type - sample, avidemux file
seasonnaming="Season " ### Naming to check for season folders
mediafolder="/Media" ### add to path beginning for TVHeadend update
waittime=3 ### time to wait if file is in use
embyapikey="keyhere" ### api key to update emby library
plextoken="tokenhere" ### token to update plex library
 
 
tvhuser="user"
tvhpass="password"
tvhip="192.168.1.2"
 
cd $startpath
 
find . -mindepth 2 -iname $searchpattern|sed "s|^\./||"|while read fname; do
echo "$fname"
sourcefile=$(basename "$fname")
filenameonly="${sourcefile%.*}"
endfile="$filenameonly$matchpattern"
extrafile="$sourcefile$extradelpattern"
filepath=$(dirname "$fname")
seasonpath=$(basename "$filepath")
 
if [[ $seasonpath == "$seasonnaming"* ]]; then
seasonpathnew=$(echo "$seasonpath" | sed -E 's/\<[0-9]\>/0&/')
seriespath=$(dirname "$filepath")
tvhfinalpath="$mediafolder/$seriespath/$seasonpathnew/$endfile"
else
tvhfinalpath="$mediafolder/$filepath/$endfile"
fi
 
echo "output path is: $tvhfinalpath"
 
cd "$startpath/$filepath"
 
if ! [ -n "$(lsof "$sourcefile")" ]; then
if ! [ -f "$extrafile" ]; then
docker exec Avidemux /usr/bin/avidemux3_cli --load /storage/"$fname" --quit > /dev/null
echo echo "$sourcefile loading in avidemux ..."
else
echo echo "$extrafile already there..."
fi
else
echo echo "$sourcefile in use ..."
fi
 
if [ -f "$endfile" ]; then
echo "$endfile found, processing ..."
if ! [ -n "$(lsof "$endfile")" ]; then
echo "File $endfile free"
 
if [[ $seasonpath == "$seasonnaming"* ]]; then
cd ..
mkdir "$seasonpathnew"
mv "$seasonpath/$endfile" "$seasonpathnew/"
fi
 
curl -s "http://"$tvhuser":"$tvhpass"@"$tvhip":9981/api/dvr/entry/filemoved" --data-urlencode "src=$mediafolder/$filepath/$sourcefile" --data-urlencode "dst=$tvhfinalpath"
 
cd "$startpath/$filepath"
rm "$sourcefile"
rm "$extrafile"
if [[ ! $seasonpath == "$seasonpathnew" ]]; then
cd ..
rmdir "$seasonpath"
fi
else
echo "$endfile in use"
fi
else
echo "$endfile not found."
fi
done
---
Link to comment
Share on other sites

Angelblue05

I fully understand your workflow, thank you. I just wanted you to confirm if the season was deleted in your last test to explain what I see in your log.

Link to comment
Share on other sites

alturismo

and as note, may living room (where i first checked yesterday) i was too late in updating script and cleaning ... the .ts file was already there "before" database update.

 

bedroom and extra room are ok today morning, will see when all episodes are seen and if the folders get out of sight ...

 

living room i made another database clean last nite after my failed message here, because the 1st entry (.ts) was done "before" updating script and cleanup database.

 

Now the state is all 3 shield tv´s are on 4023a and had a cleanup and rebuild database with 0 .ts files wich could be replaced ... only new ones coming now ;)

 

and additionally, i guess this behavior only occurs while clients are live connected, sample, my working pc has no issues, and my laptop also is fine with addon 4014 installed (just checked),

but they are almost never live connected while updates are coming ... just as note in case of interest ...

 

and, just tested on my firetv, wich wasnt online for some time ... alot of updates, all good, so i really assume its only with live connected clients ...

  • Like 1
Link to comment
Share on other sites

alturismo

ok, correction on live devices where i thought it worked out better.

 

episodes from the current seasons are all gone on clients, samples see pics below

 

just took a look from a device wich synced yesterday after updating etc.

 

in both seasons i did the "workflow" from latest episode, all other episodes from that season are gone ...

 

sample, z nation 5x01 - 5x10 are gone, leftover is the one wich was recorded and edited yesterday, sample midnight texas, 2x01 - 2x06 gone, same procedure ...

 

screens and logs attached

post-112497-0-91451700-1558072966_thumb.png

post-112497-0-96964400-1558072979_thumb.png

kodi.old.log

kodi.log

  • Like 1
Link to comment
Share on other sites

Angelblue05

I see why things got deleted. I will have to check what I can do to fix this. In the meantime, if you do not delete the season folder, but the episode instead then you should not have issues.

 

The reason season content is missing is because Emby sends a delete request for the season folder and that deletes all the child episodes linked to it as there is only one season # folder in Kodi even if you have multiple season, like 8 or 08 folders in Emby.

Edited by Angelblue05
Link to comment
Share on other sites

alturismo

I see why things got deleted. I will have to check what I can do to fix this. In the meantime, if you do not delete the season folder, but the episode instead then you should not have issues.

 

The reason season content is missing is because Emby sends a delete request for the season folder and that deletes all the child episodes linked to it as there is only one season # folder in Kodi even if you have multiple season, like 8 or 08 folders in Emby.

 

aha, great you found that out, thanks for the info.

 

i may consider rewriting then some parts here to record externally and move when done to a proper folder.

 

i know my workflow seems a bit strange ;) but i like to keep my structures with 2 digit season folders.

 

thanks alot for looking into it, i hope the double entries etc are fixed, i ll let you know, next record tonite ;)

  • Like 1
Link to comment
Share on other sites

alturismo

ok, reconfigured now so emby wont be affected by all these file and folder changes anymore ... probably best solution for now.

 

workflow now is, record dir outside emby directory, editing (cut, remux and move to 2 digit folder), THEN move to the regular TVRIPS directory in the 2 digit season subfolder ... ;)

 

when u want me to test after an update (if a fix is possible), let me know, i d prefer my old workflow (have the records directly in emby), but for now im fine ... ;)

i also kept my old setup script etc here ... so easy test possible.

Edited by alturismo
  • Like 1
Link to comment
Share on other sites

heula

@heula

 

Are you still having difficulties?

 

Yes, I'm still having issues on one of my pc's.

Another pc picked up everything this morning but the other one not.

 

I never have issues on my Nvidia shield TV.

 

kodi PC 1.log

kodi.old PC 1.log

kodi PC 2.log

kodi.old PC 2.log

 

Shield TV log will be added later today,

 

Thanks.

  • Like 1
Link to comment
Share on other sites

Angelblue05

@@heula

 

Can you please give it another go with 4.0.25? There was an error in code.

 

You'll probably want to update your affected libraries to get all missing content since and retest. I think this time it will be successful to complete the start up sync. Keep me posted.

  • Like 1
Link to comment
Share on other sites

heula

@@heula

 

Can you please give it another go with 4.0.25? There was an error in code.

 

You'll probably want to update your affected libraries to get all missing content since and retest. I think this time it will be successful to complete the start up sync. Keep me posted.

I will test and keep you posted.

Thanks.

Link to comment
Share on other sites

heula

Still issues on the pc's. Shield tv has no issue.

 

Shield TV

Kodi always open

 

kodi Shield TV.log

kodi Shield TV.old.log

 

All new added episodes and tv shows in Emby are also visible in Kodi.

 

post-310-0-59587100-1558719622_thumb.jpg

 

PC Room 1

Kodi always open even when PC goes in sleep mode. Kodi continues where it was before sleep mode when the pc wakes up again.

 

kodi PC Dylan.log

kodi PC Dylan.old.log

 

Example of Missing episodes are Chicago PD S06E22 and The 100 S06E04. But there are some more.

 

post-310-0-22712300-1558719646_thumb.jpg

 

PC Room 2

Kodi always open even when PC goes in sleep mode. Kodi continues where it was before sleep mode when the pc wakes up again.

 

kodi Slaapkamer.log

kodi Slaapkamer.old.log

 

Example of Missing episodes are Chicago PD S06E22 and The 100 S06E04. But there are some more.

 

post-310-0-98840800-1558719663_thumb.jpg

 

Those missing episodes were there after a manual library update in Kodi.

 

Hope you can figure out why the Shield TV has no issues and the PC's stiil do.

Maybe because the network location to the Shield TV is always available even when Shield TV is in sleep mode. The network to the PC's are unavailable when the pc's are in sleep mode.

I see that when Kodi is open on a pc that is not in sleep mode the new episodes do appear. The older ones that were added to Emby while those PC's were in sleep mode seems to be the problem some how.

 

Thanks for all your work.

Edited by heula
  • Like 1
Link to comment
Share on other sites

heula

Results from this morning.

 

Shield TV has all updates done well

 

post-310-0-70929800-1558772168_thumb.jpg

 

kodi Shield TV.log

 

 

PC 1 not (not checked PC 2 but shall be the same issue)

 

post-310-0-14189200-1558772221_thumb.jpg

 

kodi Slaapkamer.log

 

At least missing Warrior (2019) S01E08 and Deep State S02E03 on the PC

 

PC was all night in sleep mode and woke up this morning.

When the PC is awake  and I remove an episode on Shield TV in Kodi I see them both disappear at the same time. So when awake it seems to go well.

 

Have a nice weekend.

Edited by heula
  • Like 1
Link to comment
Share on other sites

Angelblue05

I will have a look at your logs tonight. Thanks for your patience @@heula.

 

If the shield is always on,then it never uses the fast sync and always use live updates, unless it sleeps and gets disconnected. The fast sync records live updates and returns it to the device, so it shouldn't differ much from live updates, except that it is all time based. Maybe there is an issue with the time the add-on saves the last update happened, causing it to query for updates from the wrong time frame?

Edited by Angelblue05
  • Like 1
Link to comment
Share on other sites

Angelblue05

@@heula

 

Restart Emby for Kodi, you should see a new pafch applied. Bring your libraries up to date once more. This time, if should keep up. The issue was related to newly added shows (or maybe the show was empty previously?). Anyway, I ensure to add the episodes if the show is added via live updates/fast sync. That should correct what you are seeing.

Edited by Angelblue05
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...