Path Subsititution for Playlists works with the exception of 1 addon

I rely heavily on the Addon LazyTV
https://forum.kodi.tv/showthread.php?tid=170975

It creates a smart playlist with all next unwatched episodes of your library. This way when we want to watch something we start this addon, and it will play 5 episodes of TV shows we are currently watching, but it is random. This is a great way to work through our library.

The way this Addon works is that after a reboot or library update, LazyTV will start scanning all unwatched episodes and build a smart playlist.
This playlist is called: LazyTV.xps and is created in special://profile/playlists/video/

In my advancedsettings.xml I have a section like this:

	<pathsubstitution>
		<substitute>
			<from>special://profile/playlists/</from>
			<to>smb://HYPERV/KODI$/Profile/playlists/</to>
	  </substitute>
	</pathsubstitution>

All my playlists are loaded from the SMB location and when I edit something it is done on the file share, with the exception of the LazyTV.xsp that one is always created in /home/osmc/.kodi/userdata/playlists/video/

Since I have multiple media players, I would really like the LazyTV playlist to also be shared between all my devices.

Have also enabled debugging, but it does not show me any reason why it behaves like this.

I know this is not an OSMC issue but since the dev of the addon seems to have abandoned the addon I was hoping on some magic through here :smiley:

May I suggest to do a kernel mount for your SMB share and then to create a symlink fromthat folder to the mount point.

Sorry for being such a noob, but how would I go about that?

Well mounting your shares can either be done via fstab or autofs (my recommendation). After you then have done that (e.g. mounted to /mnt/my-server/XYZ where XYZ is hte path to your playlist you then could set a symlink with ln -s /mnt/my-server/XYZ /home/osmc/.kodi/userdata/playlists

2 Likes

Have the fstab mnt up and runing and I can browse the network share from the command line after the mount
However the symlink gives me some issues.
Ran this command ln -s /mnt/profile_shared/playlists/ /home/osmc/.kodi/userdata/playlists/
This ended up with a symlink file, but from Kodi it is not yet browsable or visible
image

Can I remap the entire playlist folder and all its content?
Have read through this and it appears it should.
Symlink Tutorial in Linux – How to Create and Remove a Symbolic Link

EDIT:
Figured it out the command needed to be:
ln -s /mnt/profile_shared/playlists /home/osmc/.kodi/userdata

EDIT2:
And yes this works! :partying_face:
The playlists is now created on the network share.

Thank you

@fzinken Sorry to bother you here again :smiley:
Since I started with v19 I now have a clean slate and wanted to use the autofs mount instead of fstab and followed your guide but it is not mapping.
Running the troubleshooting commands, it shows.

osmc@htpc1:/mnt$ sudo systemctl stop autofs
osmc@htpc1:/mnt$ sudo automount -f -v -d
Starting automounter version 5.1.2, master map /etc/auto.master
using kernel protocol version 5.02
lookup_nss_read_master: reading master file /etc/auto.master
do_init: parse(sun): init gathered global options: (null)
lookup_read_master: lookup(file): read entry +dir:/etc/auto.master.d
lookup_nss_read_master: reading master dir /etc/auto.master.d
lookup_read_master: lookup(dir): scandir: /etc/auto.master.d
lookup_read_master: lookup(file): read entry +auto.master
lookup_nss_read_master: reading master files auto.master
do_init: parse(sun): init gathered global options: (null)
lookup(file): failed to read included master map auto.master
lookup_read_master: lookup(file): read entry /-
master_do_mount: mounting /-
automount_path_to_fifo: fifo name /var/run/autofs.fifo--
lookup_nss_read_map: reading map file /etc/auto.smb.shares
do_init: parse(sun): init gathered global options: (null)
mounted direct on /mnt/profile_shared with timeout 15, freq 4 seconds
do_mount_autofs_direct: mounted trigger /mnt/profile_shared
st_ready: st_ready(): state = 0 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 4102026320 path /-
expire_cleanup: got thid 4102026320 path /- stat 0
expire_cleanup: sigchld: exp 4102026320 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 4102026320 path /-
expire_cleanup: got thid 4102026320 path /- stat 0
expire_cleanup: sigchld: exp 4102026320 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 4102026320 path /-
expire_cleanup: got thid 4102026320 path /- stat 0
expire_cleanup: sigchld: exp 4102026320 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 4102026320 path /-
expire_cleanup: got thid 4102026320 path /- stat 0
expire_cleanup: sigchld: exp 4102026320 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 4102026320 path /-
expire_cleanup: got thid 4102026320 path /- stat 0
expire_cleanup: sigchld: exp 4102026320 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 4102026320 path /-
expire_cleanup: got thid 4102026320 path /- stat 0
expire_cleanup: sigchld: exp 4102026320 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 4102026320 path /-
expire_cleanup: got thid 4102026320 path /- stat 0
expire_cleanup: sigchld: exp 4102026320 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 4102026320 path /-
expire_cleanup: got thid 4102026320 path /- stat 0
expire_cleanup: sigchld: exp 4102026320 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
^Cdo_notify_state: signal 2
master_notify_state_change: sig 2 switching /- from 1 to 5
st_prepare_shutdown: state 1 path /-
expire_proc: exp_proc = 4100973648 path /-
expire_cleanup: got thid 4100973648 path /- stat 0
expire_cleanup: sigchld: exp 4100973648 finished, switching from 5 to 7
st_shutdown: state 5 path /-
umount_multi: path /mnt/profile_shared incl 0
set_direct_mount_catatonic: set /mnt/profile_shared catatonic
umounted direct mount /mnt/profile_shared
automount_path_to_fifo: fifo name /var/run/autofs.fifo--
shut down path /-
autofs stopped

content of /etc/auto.smb


#
# Sample auto.master file
# This is a 'master' automounter map and it has the following format:
# mount-point [map-type[,format]:]map [options]
# For details of the format look at auto.master(5).
#
#/misc  /etc/auto.misc
#
# NOTE: mounts done from a hosts map will be mounted with the
#       "nosuid" and "nodev" options unless the "suid" and "dev"
#       options are explicitly given.
#
#/net   -hosts
#
# Include /etc/auto.master.d/*.autofs
# The included files must conform to the format of this file.
#
+dir:/etc/auto.master.d
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master
/- /etc/auto.smb.shares --timeout 15 browse

content of /etc/auto.smb.shares

/mnt/profile_shared -fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc,vers=3.0 ://hyperv/KODI$/Profile

When browsing to the share it shows

osmc@htpc1:/mnt$ sudo systemctl restart autofs
osmc@htpc1:/mnt$ ls
profile_shared
osmc@htpc1:/mnt$ cd profile_shared/
-bash: cd: profile_shared/: No such file or directory
osmc@htpc1:/mnt$

EDIT:
It looks like it does not like the $ sign in the share

handle_packet: type = 5
handle_packet_missing_direct: token 3, name /mnt/profile_shared, request pid 3228
attempting to mount entry /mnt/profile_shared
lookup_mount: lookup(file): looking up /mnt/profile_shared
lookup_mount: lookup(file): /mnt/profile_shared -> -fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc,vers=3.0 ://hyperv/KODI$/Profile
parse_mount: parse(sun): expanded entry: -fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc,vers=3.0 ://hyperv/KODI/Profile
parse_mount: parse(sun): gathered options: fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc,vers=3.0
parse_mount: parse(sun): dequote("://hyperv/KODI/Profile") -> ://hyperv/KODI/Profile
parse_mount: parse(sun): core of entry: options=fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc,vers=3.0, loc=://hyperv/KODI/Profile
sun_mount: parse(sun): mounting root /mnt/profile_shared, mountpoint /mnt/profile_shared, what //hyperv/KODI/Profile, fstype cifs, options rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc,vers=3.0
do_mount: //hyperv/KODI/Profile /mnt/profile_shared type cifs options rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc,vers=3.0 using module generic
mount_mount: mount(generic): calling mkdir_path /mnt/profile_shared
mount_mount: mount(generic): calling mount -t cifs -o rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc,vers=3.0 //hyperv/KODI/Profile /mnt/profile_shared
>> mount error(2): No such file or directory
>> Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount(generic): failed to mount //hyperv/KODI/Profile (type cifs) on /mnt/profile_shared
dev_ioctl_send_fail: token = 3
failed to mount /mnt/profile_shared

Did you recreate that file?

Do you have proper name resolution?

Yes created the file and have dns

Issue is the $ sign in the share name.
Had to escape that with a \ now auto.smb.shares is

/mnt/profile_shared -fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc,vers=3.0 ://hyperv/KODI\$/Profile