gavan

Program (bash) access to "Not Watched" status

Recommended Posts

I am building/refining a script to keep my HD from getting overfull. We will take it as read and say a truly good person would be doing regular pruning and keeping things from getting out of hand. I am not that person so the drive gets pretty full and drastic measures have been needed. This script is part of a better plan. The bash script moves some recordings to another drive for archive storage and removes others. 

As part of this I would like to know if a recording has been watched. I have found a flag in the .eyetvt folder associagted with each recording which marks whether the recording "IsUnplayed" and this does toggle to false once the recording has been played. My problem is it does not toggle back when the recording is marked "Not Watched" via the Eye TV interface. Clearly Eye TV knows the status of this setting bit I can't access it myself.

I would like to use this "Not Watched" status to prune those recordings which have been watched already.  Here is a fragment…

#!/usr/bin/env -S -P/usr/local/bin:/usr/bin:/bin bash
# FWIW: GNU bash, version 4.4.5(1)-release (x86_64-apple-darwin16.3.0)
# ...etc...
##### Configuration
##### 2018-06-21
#	Geniatech EyeTv 3.6.9
#	macOS High Sierra 10.13.5

# Rule 3 -- Over two weeks old and has been watched
#
REGEX=".*${SFX}\$"	# Pattern to find all the relevant files, ${SFX}='\.eyetv'
for ii in `find -E . -type d -regex ${REGEX} -Btime +2w -print`; do	# TODO check dates
	pList=`find -E ${ii} -type f -regex ".*\.eyetvr\$" -print` # identify the .plist file
	isUnplayed=`/usr/libexec/PlistBuddy -c "print :isUnplayed" ${pList}` # check the flag
	if [ $isUnplayed == 'false' ] ; then
		echo "DEBUG: isUnplayed::${isUnplayed}] -- Delete this recording?:: `ls -dl ${ii}`"
	fi
done

Does anybody know where this "Not Watched" is kept so I can access it?

FWIW in looking for an alternate approach I have not been able to find an Applescript property which gives this status but may have missed it. If there is such a property I would be happy to use it rather then poking into .plist files.

Thanks in advance.

Share this post


Link to post
Share on other sites
On 6/21/2018 at 3:33 PM, gavan said:

I am building/refining a script to keep my HD from getting overfull. We will take it as read and say a truly good person would be doing regular pruning and keeping things from getting out of hand. I am not that person so the drive gets pretty full and drastic measures have been needed. This script is part of a better plan. The bash script moves some recordings to another drive for archive storage and removes others. 

As part of this I would like to know if a recording has been watched. I have found a flag in the .eyetvt folder associagted with each recording which marks whether the recording "IsUnplayed" and this does toggle to false once the recording has been played. My problem is it does not toggle back when the recording is marked "Not Watched" via the Eye TV interface. Clearly Eye TV knows the status of this setting bit I can't access it myself.

I would like to use this "Not Watched" status to prune those recordings which have been watched already.  Here is a fragment…


#!/usr/bin/env -S -P/usr/local/bin:/usr/bin:/bin bash
# FWIW: GNU bash, version 4.4.5(1)-release (x86_64-apple-darwin16.3.0)
# ...etc...
##### Configuration
##### 2018-06-21
#	Geniatech EyeTv 3.6.9
#	macOS High Sierra 10.13.5

# Rule 3 -- Over two weeks old and has been watched
#
REGEX=".*${SFX}\$"	# Pattern to find all the relevant files, ${SFX}='\.eyetv'
for ii in `find -E . -type d -regex ${REGEX} -Btime +2w -print`; do	# TODO check dates
	pList=`find -E ${ii} -type f -regex ".*\.eyetvr\$" -print` # identify the .plist file
	isUnplayed=`/usr/libexec/PlistBuddy -c "print :isUnplayed" ${pList}` # check the flag
	if [ $isUnplayed == 'false' ] ; then
		echo "DEBUG: isUnplayed::${isUnplayed}] -- Delete this recording?:: `ls -dl ${ii}`"
	fi
done

Does anybody know where this "Not Watched" is kept so I can access it?

FWIW in looking for an alternate approach I have not been able to find an Applescript property which gives this status but may have missed it. If there is such a property I would be happy to use it rather then poking into .plist files.

Thanks in advance.

It is in  ~/Documents -> EyeTV Archive -> In the container file with .eyetv extension (right click on it and choose Show Package Contents) there you will see a XML file  *.eyetvr

 

in this.eyetvr there is a key starts with <key>isUnplayed</key>  

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now