Symbolic links to external drive in videos, used to work?

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

Post Reply
wmorrison
Senior
Posts: 165
Joined: Sat Dec 01, 2018 12:05 am
United States of America

Symbolic links to external drive in videos, used to work?

Post by wmorrison »

For months, maybe a year or so, I've been adding files on an external USB drive to video library like this:

- Create local folder(s) under videos
- Create symbolic links in these folders to files on external drive
- Either mythutil --scanvideos for all, or call Video/AddVideo API to add a single file

This used to work great. I do it because I want to "delete" the file from video library after I've watched it, without actually deleting the external file. Myth deletes the link, so it's no longer in my list of videos.

As of a couple days ago, I noticed this is no longer working.

- Files are detected
- Symbolic links to files on same drive are detected
- Symbolic links to files on external drive are not detected, message in log says "Provided filename does not exist!"

I don't know what changed, or when. I haven't updated MythTV in a few months, at least, or a full apt upgrade, maybe installed a few programs.

I don't think the problem is MythTV. I suspect something in qt changed? Or whatever qt calls? I find the error above in video.cpp in AddVideo.

QString fullname = sgroup.FindFile(sFileName);

if ( !QFile::exists(fullname) )
throw( QString( "Provided filename does not exist!" ));

I also looked in StorageGroup::FindFile. I don't see any of the errors there in logs, so it appears that part worked, but QFile::Exists returned false?

To be sure what's happening, I created a folder under videos where I put:

- An actual file
- A symbolic link to a different file on the same drive
- A symbolic link to a third file on the external drive (verified the drive was mounted and the file could be accessed via the link)

Ran mythutil --scanvideos, the local file and link to file on same drive appeared in videos, but not the link to external file.

Any ideas what to look for next? I haven't worked with qt much. Is there some configuration that controls what it considers a "file?" (allow/disallow links, or links crossing filesystems?)
wmorrison
Senior
Posts: 165
Joined: Sat Dec 01, 2018 12:05 am
United States of America

Re: Symbolic links to external drive in videos, used to work?

Post by wmorrison »

No ideas?

I cranked up logging and verified FindFile logs that the file was found. So it is definitely QFile.exists that is the problem.

Documentation for QFile::exists says it should return true for a symlink, unless the target does not exist (but it does exist.) And worked until recently.
wmorrison
Senior
Posts: 165
Joined: Sat Dec 01, 2018 12:05 am
United States of America

Re: Symbolic links to external drive in videos, used to work?

Post by wmorrison »

I finally figured this out. It wasn't either MythTV or Qt.

Attributes for /media/[username] where the external drive is mounted didn't allow user mythtv to read it, even though all the subdirectories on the actual drive were set correctly.

Running mythutil --scanvideos triggers MythTV to run the scan, but as user mythtv, not the user that ran mythutil.

I don't know when the attributes of /media/[username] got changed. Like I said, it used to work, and I don't recall changing it. But chmodding the directory fixed it.

Works great, symbolic links in videos are my "playlist," deleting them from MythTV after watching leaves the actual files on the external drive alone.
Post Reply