mythfs-0.3.1

A new version of MythFS. Besides a lot of code improvements, this version supports the deletion of recordings. The recordings will be deleted by communicating with the native protocol to the MythTV backend. Therefore, MythFS now speaks the native protocol.

Everybody familiar with MythTV will know, that this protocol changes for each version of MythTV and that protocol versions are incompatible. MythFS currently speaks protocol version 40 and 44. In case you want to use MythFS with a MythTV version that speaks another version of the protocol, please install the most recent version of MythFS, run mythfsdump > mythfsdump.out and email me the output saved in mythfsdump.out. The output contains enough information for me to reverse engineer your version of the MythTV protocol and to release an update.

As always, the most recent release of MythFS is found on Sourceforge.

Another bugfix

If one starts mythfsd on OSX as a System Daemon using launchd, then os.getenv("HOME") returns None which is an illegal argument to os.path.join(). Here are some fixes in config.py

config.py line 50

paths = ["/etc/mythtv",]
homedir = os.getenv("HOME")
if homedir is not None and homedir!="":
→ paths.append( os.path.join(homedir, ".mythtv") )
for path in paths:
→ filename = os.path.join(path, "mysql.txt")

config.py line 114

paths = ["/etc/mythfs/mythfs.conf", "/etc/mythfs.conf"]
homedir = os.getenv("HOME")
if homedir is not None and homedir!="":
→paths.append( os.path.join(homedir, ".mythfsrc") )
for filename in paths:

Bugfixes

Hi there

I have a couple bugfixes for you. These are necessary to make the filesystem work for me on OSX 10.5.8, which it now does.

mythproto.py Line 28

port = int(mythfsconfig.get('myth_port')) # myth_port can sometimes come back as a string. Force integer.

mythdb.py line 529

for mount in os.popen("mount"):
try:
dev, tmp, mountpoint, tmp, type, tmp = mount.split()
mounts[dev] = mountpoint
except:
# Warn rather than crash if the operating system has an unexpected format for mount output
logging.warning(" could not split info from mount command for mount result: %s"%(mount,))

Trying it on a 2009 Mac Mini

Hi

This is a brilliant idea.

I have a couple comments, and a bug/problem. First off, just so everyone can keep track at home, the full set of dependencies to build and use mythfs on a fresh Leopard 10.5.8 install is as follows:

(1) Download and install XCode
(2) Download and install pkg-config
(3) Download and install MacFuse
(4) Download and install fuse-python
(5) (a) Have a mysql_config file available, as after a MySQL installation
(5) (b) Download and install MySQL-python
(6) Download and install mythfs

Now for the bug/problem: In my case I get the directory structure I am supposed to but when I try to read or list any of the files at the third level (for example, the contents of Programs/ ) I get something like this:

dvr:~ dvr$ ls -l /Television/Programs/MLB\ Baseball
ls: /Television/Programs/MLB Baseball: Invalid argument

In the logfile I get nothing too useful:

2009-11-06 20:38:31,917 [DEBUG] retrieve_items: retrieving items from database for path: /Programs/MLB Baseball
2009-11-06 20:38:31,917 [DEBUG] retrieve_items: executing query: select chanid, starttime, title, subtitle, progstart, filesize, basename from recorded where lower(title) like lower('MLB Baseball') order by title, progstart

I checked, and that SQL query works fine:

1321 2009-11-04 18:51:00 MLB Baseball World Series, Game 6: Philadelphia Phillies at TBA 2009-11-04 18:30:00 17991042580 1321_20091104185100.mpg

Any ideas?

Protocol

I should mention more about my backend


dvr:mythfs-0.3.1 dvr$ head /var/log/myth/MythBackend
2009-05-17 21:34:39.945 MythBackend version: trunk [20121] www.mythtv.org

and


dvr:mythfs-0.3.1 dvr$ telnet localhost 6543
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying fe80::1...
telnet: connect to address fe80::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
21 MYTH_PROTO_VERSION 44
13 ACCEPT[]:[]44

Finally the contents of my configuration file are:

dvr:mythfs-0.3.1 dvr$ cat /etc/mythfs.conf
# $Id: mythfs.conf.example 236 2009-05-28 15:24:26Z michielf $
mount = /Television
mountoption = allow_other
logfile = /var/log/mythfs.log
loglevel = DEBUG
myth_proto_version = 44
myth_host = localhost
myth_port = 6543