Release TvTunes alternative for playing soundtracks when browsing
#1
Hi, I have been long waiting for some alternative to play soundtracks when browsing movies and tvshows without TvTunes addon. I already had a theme.mp3 file in every movie/tvshow folder, so it was just a matter of playing them while browsing. I have devised a way without even using any addon, it consists on adding three little xml.files to your xml's skin folder, for instance:

customStartSoundtrack.xml

<window type="dialog" id="1355">
    <onload>Stop</onload>
    <onload condition="String.IsEmpty(Window(home).Property(PlayingOST)) + !String.Contains(ListItem.Path,http)">PlayMedia($ESCINFO[ListItem.Path,,theme.mp3])</onload>
    <onload>SetProperty(OST,$INFO[ListItem.Path],home)</onload>
    <onload>SetProperty(PlayingOST,True,home)</onload>
    <visible>System.IdleTime(2) + [!String.IsEqual(ListItem.Path,Window(home).Property(OST)) | !Player.Playing]</visible>
    <visible>!ListItem.IsCollection + !String.Contains(ListItem.Path,thumb:) + !String.Contains(ListItem.Path,image:) + !String.Contains(ListItem.Path,plugin) + !String.Contains(ListItem.Path,videodb:)</visible>
    <visible>Container.Content(movies) | [Container.Content(tvshows) + !Player.Playing] | [Container.Content(seasons) + !Player.Playing]</visible>
    <visible>!Window.IsActive(movieinformation)</visible>
    <visible>Window.IsActive(videos)</visible>
    <controls>
    </controls>
</window>

...and...

customStopSoundtrack.xml

<window type="dialog" id="1255">
    <onload condition="Player.Playing">Pause</onload>
    <onload>ClearProperty(PlayingOST,Home)</onload>
    <visible>!String.IsEqual(ListItem.Path,Window(home).Property(OST))</visible>
    <visible>Container.Content(movies) | Container.Content(tvshows)</visible>
    <visible>!Window.IsActive(movieinformation)</visible>
    <controls></controls>
</window>

...and...

customRidSoundtrack.xml

<window type="dialog" id="1305">
    <onload>Stop</onload>
    <onload>ClearProperty(PlayingOST,Home)</onload>
    <visible>String.Contains(Player.Filenameandpath,theme.mp3) + [!Window.IsActive(videos) | String.IsEmpty(ListItem.Path) | ListItem.IsCollection]</visible>
    <controls>
    </controls>
</window>

It should work in every skin and can be tested without much hassle...

If you happen to have in your skin an option to go fullscreen when music starts to play you should find and edit that xml, it could be named something like CustomMusicFullscreen.xml or something like that, then you have to change line from...
<onload condition="!Window.IsActive(visualisation)">FullScreen</onload>
...to...
<onload condition="!Window.IsActive(visualisation) + !Window.IsActive(videos)">FullScreen</onload>


Edit 1: (updated 24/05/18) From 30/03 nightlies onwards (13699 (PR)) you could get unwanted effects in screen; it's related to the file DialogBusy.xml and to solve the issue it's necessary to add an onload with a condition at the beginning of DialogBusy.xml, just after the <window> line...
<window>
<onload condition="String.Contains(Player.Filenameandpath,theme.mp3) | !String.IsEmpty(Window(home).Property(PlayingOST))">Dialog.Close(all,true)</onload>
...to prevent DialogBusy.xml from running when playing the theme.mp3 files


Edit 2: Change in third line of customStartSoundtrack.xml to prevent a bug that freezes Kodi when using an addon to select online artworks:
Old:
<onload condition="String.IsEmpty(Window(home).Property(PlayingOST))">PlayMedia($ESCINFO[ListItem.Path,,theme.mp3])</onload>
New:
<onload condition="String.IsEmpty(Window(home).Property(PlayingOST)) + !String.Contains(ListItem.Path,http)">PlayMedia($ESCINFO[ListItem.Path,,theme.mp3])</onload>

Edit 3: Change in customStartSoundtrack.xml to prevent error messages when browsing online video streams:
Old:
<visible>!ListItem.IsCollection + !String.Contains(ListItem.Path,thumb:) + !String.Contains(ListItem.Path,image:)</visible>
New:
<visible>!ListItem.IsCollection + !String.Contains(ListItem.Path,thumb:) + !String.Contains(ListItem.Path,image:) + !String.Contains(ListItem.Path,plugin)</visible>

Edit 4: See edit 1

Edit 5: Change in customStartSoundtrack.xml to prevent errors when option 'Show parent folder items' is selected:
Old:
<visible>!ListItem.IsCollection + !String.Contains(ListItem.Path,thumb:) + !String.Contains(ListItem.Path,image:) + !String.Contains(ListItem.Path,plugin)</visible>
New:
<visible>!ListItem.IsCollection + !String.Contains(ListItem.Path,thumb:) + !String.Contains(ListItem.Path,image:) + !String.Contains(ListItem.Path,plugin) + !String.Contains(ListItem.Path,videodb:)</visible>
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button)
Reply
#2
Hello @manfeed

I created these two xml files and added them to Transparency! and restarted Kodi. They work great!!

I imagine you have no control over this, but do you have any idea why it will play mp3 themes, but not flac themes?
My Signature
Links to : Forum rules (wiki) | Banned_Add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create_Music_Library (wiki) | HOW-TO:Create_Video_Library (wiki) || Artwork (wiki) | Basic_controls (wiki) | Import-export_library (wiki) | Movie_sets (wiki) | NFO_files (wiki) | Quick start guide (wiki)
Reply
#3
(2018-04-15, 11:45)Karellen Wrote: Hello @manfeed

I created these two xml files and added them to Transparency! and restarted Kodi. They work great!!

I imagine you have no control over this, but do you have any idea why it will play mp3 themes, but not flac themes?

You have to change the onload condition if your theme files are flac:
Code:
<onload>PlayMedia($INFO[ListItem.Path,,theme.mp3])</onload>

Change to
Code:
<onload>PlayMedia($INFO[ListItem.Path,,theme.flac])</onload>

Unfortunately, there is no way to check whether a local file exits in the skinning engine, so you are stuck with choosing one particular file type.
I haven't tested, but you might be able to get away with stacking them together. Off the top of my head, I'm not sure if PlayMedia will stop playback even if the file doesn't exist.
e.g. You could try
Code:
<onload>PlayMedia($INFO[ListItem.Path,,theme.mp3])</onload>
<onload>PlayMedia($INFO[ListItem.Path,,theme.flac])</onload>
Reply
#4
@jurialmunkey 

FYI
 
Code:
RunScript(script.skin.helper.service,action=fileexists,file=[filenamepath],skinstring=[skinstring to store the result],windowprop=[windowprop to store the result])
Quote:This command will check the filesystem if a particular file exists and will write the results to either a skin string or window property. If the file exists, the result will be written as EXISTS in the property or skinstring, if it doesn't exist, the property/string will be empty.
Embuary | Skin | Helper | Info | Repo | GitHub
Reply
#5
I have updated the first post with an improved new method that allows a smoother browsing and in addition the soundtrack won't stop nor restart in video information and other windows.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button)
Reply
#6
Great to see that there is now an alternative to TvTunes. Nevertheless it won't work for me in v18 with Estuary or EstuaryModV2.
Cinema: Denon X7200WA, Epson EH-TW7300, Samsung 55KS7090
HTPC: Win10-1809, SilverStone GD02B-MT, GA-H170M-D3H, Intel i3-7100, GTX 1050 Ti, DuoFlex S2 CI, UHD BU40N
WHS: Server 2016 Essentials, GA-Z170N-WIFI, Intel i5-6600
Reply
#7
I have checked in v18 and Estuary official and in works faultlessly for me...
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button)
Reply
#8
Ok, tried again and now it works with Estuary but still not with EstuaryMod2. I will ask Guilouz.
Cinema: Denon X7200WA, Epson EH-TW7300, Samsung 55KS7090
HTPC: Win10-1809, SilverStone GD02B-MT, GA-H170M-D3H, Intel i3-7100, GTX 1050 Ti, DuoFlex S2 CI, UHD BU40N
WHS: Server 2016 Essentials, GA-Z170N-WIFI, Intel i5-6600
Reply
#9
Thanks for this! I've missed TvTunes alot.

It seems to work pretty well for me (Kodi 17.6, Aeon Nox 5: SiLVO SKIN, v6.0.13). I wasn't exactly sure where to put the files but I put them here:
Users\WiFi_\AppData\Roaming\Kodi\addons\skin.aeon.nox.silvo\16x9 and it works! Now to find a few dozen new theme files...

Thanks again!
LibreELEC 9.X.X, Aeon Nox 5 SiLVO, NUC7i5BNK (i5-7260U, Intel Iris Plus Graphics 640, 8 GB ram, 250 GB M.2 SSD)
Samsung F6300 46" LED LCD TV, Pioneer VSX-29TX AVR, Pioneer HPM-100 speakers
Synology DS215j NAS fileserver (WD Gold 10TB x 2)
Reply
#10
(2018-04-15, 13:56)sualfred Wrote: @jurialmunkey 

FYI
 
Code:
RunScript(script.skin.helper.service,action=fileexists,file=[filenamepath],skinstring=[skinstring to store the result],windowprop=[windowprop to store the result])

Yeah I know about that, but it kinda defeats the purpose of an addon free method. Plus it's not really feasible to use for checking multiple file extensions.
Reply
#11
(2018-04-15, 17:51)tehax Wrote: Ok, tried again and now it works with Estuary but still not with EstuaryMod2. I will ask Guilouz.

Check that the window id numbers don't conflict with an existing custom window in the mod.
Reply
#12
Thanks @jurialmunkey, the following didn't quite work. Flac files played fine, mp3 files played for about 1 second then stopped. I guess it finds the mp3 file, then immediately moves onto looking for a flac file. Anyway to get an "or" in there?

(2018-04-15, 13:37)jurialmunkey Wrote: <onload>PlayMedia($INFO[ListItem.Path,,theme.mp3])</onload>
<onload>PlayMedia($INFO[ListItem.Path,,theme.flac])</onload>

I haven't tried the updated @manfeed version in post 1 yet, but it looks as if it is still limited to mp3 only.
My Signature
Links to : Forum rules (wiki) | Banned_Add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create_Music_Library (wiki) | HOW-TO:Create_Video_Library (wiki) || Artwork (wiki) | Basic_controls (wiki) | Import-export_library (wiki) | Movie_sets (wiki) | NFO_files (wiki) | Quick start guide (wiki)
Reply
#13
@Karellen - I thought that might happen. Unfortunately, that means that you are stuck with choosing only one filename/filetype to play. The updated method has the same limitation.

The only other potential solution I can think of is to use a wildcard, but I highly doubt this will work:
Code:
<onload>PlayMedia($INFO[ListItem.Path,,theme.*])</onload>
Reply
#14
Thanks @jurialmunkey

No problems and thanks for the help. It is a minor matter to convert to a single file type, so I will do that instead.

If the above suggestion works, I will post back confirming it does.

---Edit---
Nope, it did not work. Nothing plays. Thanks anyway Smile
My Signature
Links to : Forum rules (wiki) | Banned_Add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create_Music_Library (wiki) | HOW-TO:Create_Video_Library (wiki) || Artwork (wiki) | Basic_controls (wiki) | Import-export_library (wiki) | Movie_sets (wiki) | NFO_files (wiki) | Quick start guide (wiki)
Reply
#15
@Karellen for your special case only I can think of is to add another window, if would be this way (total 4 xml files)...

customStartSoundtrack.xml

<window type="dialog" id="1355">
    <allowoverlay>no</allowoverlay>
    <onload>Stop</onload>
    <onload>PlayMedia($ESCINFO[ListItem.Path,,theme.mp3])</onload>
    <onload>SetProperty(OST,$INFO[ListItem.Path],home)</onload>
    <visible>System.IdleTime(2) + [!String.IsEqual(ListItem.Path,Window(home).Property(OST)) | !Player.Playing]</visible>
    <visible>!ListItem.IsCollection</visible>
    <visible>Container.Content(movies) | [Container.Content(tvshows) + !Player.Playing] | [Container.Content(seasons) + !Player.Playing]</visible>
    <visible>!Window.IsActive(movieinformation)</visible>
    <controls>
    </controls>
</window>

customStartSoundtrackFlac.xml

<window type="dialog" id="1356">
    <allowoverlay>no</allowoverlay>
    <onload>Stop</onload>
    <onload>PlayMedia($ESCINFO[ListItem.Path,,theme.flac])</onload>
    <onload>SetProperty(OST,$INFO[ListItem.Path],home)</onload>
    <visible>System.IdleTime(3) + [!String.IsEqual(ListItem.Path,Window(home).Property(OST)) | !Player.Playing]</visible>
    <visible>!ListItem.IsCollection</visible>
    <visible>Container.Content(movies) | [Container.Content(tvshows) + !Player.Playing] | [Container.Content(seasons) + !Player.Playing]</visible>
    <visible>!Window.IsActive(movieinformation)</visible>
    <visible>!String.Contains(Player.Filenameandpath,theme.mp3)</visible>
    <controls>
    </controls>
</window>

customStopSoundtrack.xml

<window type="dialog" id="1255">
    <allowoverlay>no</allowoverlay>
    <onload>Pause</onload>
    <visible>!String.IsEqual(ListItem.Path,Window(home).Property(OST))</visible>
    <visible>Container.Content(movies) | Container.Content(tvshows)</visible>
    <visible>!Window.IsActive(movieinformation)</visible>
    <controls></controls>
</window>

customRidSoundtrack.xml

<window type="dialog" id="1305">
    <allowoverlay>no</allowoverlay>
    <onload>Stop</onload>
    <visible>[String.Contains(Player.Filenameandpath,theme.mp3) | String.Contains(Player.Filenameandpath,theme.flac)] + [!Window.IsActive(videos) | String.IsEmpty(ListItem.Path)]</visible>
    <controls>
    </controls>
</window>
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button)
Reply
 
Thread Rating:
  • 2 Vote(s) - 5 Average



Logout Mark Read Team Forum Stats Members Help
TvTunes alternative for playing soundtracks when browsing52