View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 403 posts ] 
Go to page Previous  1 ... 8, 9, 10, 11, 12, 13, 14 ... 27  Next

Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject:
PostPosted: Wed May 06, 2009 10:29 pm 
Offline
Joined: Mon Dec 24, 2007 9:47 am
Posts: 535
Location: Ottawa, Canada
Strange. I do have the latest and I see the script output telling me it does precisely as you say however it is not created and does not give an error.

I manually tested it though and the "ln -s" does fail. I was trying to allow remote mythtv users permission to write and remove their own files yet not any other files created by other users in these directories (using the "t" sticky bit). Thus protecting my core media. Surprisingly "ln -s" throws an "Operation not supported" error.

So in the end, I think it is a permission issue. I think I will need to rethink my link and permission strategy.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 06, 2009 10:46 pm 
Offline
Joined: Mon Feb 06, 2006 5:11 pm
Posts: 353
Location: Brisbane, Australia
Hi,

I could change the link command to a copy command. I'd be interested to know where the restriction lies.

BigB.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 07, 2009 5:46 pm 
Offline
Joined: Mon Dec 24, 2007 9:47 am
Posts: 535
Location: Ottawa, Canada
Given folder.jpg is usually quite small I think a cp is fine. I can't think of a good reason why the sticky bit would prevent ln from working. It may just be a bug in ln. As long as the user is always consistant in writing, linking, deleting the sticky bit should allow it. It is only really meant to prevent different users from deleting each other's files in shared directories; which is how I'm using it. The only thing which may be different is that I'm doing it over a cifs mounted file systems.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 07, 2009 5:49 pm 
Offline
Joined: Mon Feb 06, 2006 5:11 pm
Posts: 353
Location: Brisbane, Australia
Stupid question, is the filesystem that would hold the link fat32 or something? I'm still sold on the copy instead of link. I'll add that in the next revision.

BigB.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 07, 2009 8:41 pm 
Offline
Joined: Mon Dec 24, 2007 9:47 am
Posts: 535
Location: Ottawa, Canada
yikes no! :shock:

ext3 if you please. :lol:


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 07, 2009 8:43 pm 
Offline
Joined: Mon Feb 06, 2006 5:11 pm
Posts: 353
Location: Brisbane, Australia
I knew I was running the risk of insulting you on that one :-)


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 14, 2009 5:55 am 
Offline
Joined: Tue Mar 22, 2005 9:18 pm
Posts: 1422
Location: Brisbane, Queensland, Australia
I just installed and tried this on an upgraded R6 and found that it was missing one dependency. I fixed it by doing:
Code:
cpan Text::Levenshtein


Seems to be running fine now.

_________________
Girkers


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 14, 2009 6:03 am 
Offline
Joined: Tue Mar 22, 2005 9:18 pm
Posts: 1422
Location: Brisbane, Queensland, Australia
I am still having a problem with one of my videos, "BulletProof Monk". It thinks it is the TV series as the "Clean" search comes back as Monk, why is it dropping the first part of the title and then just finding the TV series?

_________________
Girkers


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 14, 2009 5:01 pm 
Offline
Joined: Mon Feb 06, 2006 5:11 pm
Posts: 353
Location: Brisbane, Australia
Hi Girkers,

The generic SCENE marker removal code sees that there is an upper case 'P' in the middle of BulletProof and thinks that it is garbage and removes it. If you rename the file to Bulletproof Monk it should work.

I am open to suggestions on how to relax this algorithm. It will also remove things like "NeW SCeNE" etc.
Code:
sub cleanUpperGarbage
{
        my $title = shift;
        #final clean up is if title like this "The Quick Brown Fox NEW SCENE"
        #then remove the uppercase part
        $tmp = $title;
        if( $title =~ /[a-z]{3,}/ )
        {
                $title =~ s/[a-zA-Z0-9]*[A-Z][a-zA-Z0-9]*[A-Z][a-zA-Z0-9]*//g;
                #strip leading whitespace
                $title =~ s/^\s*//;
                #strip trailing whitespace
                $title =~ s/\s*$//;
                #strip run of whitespace
                $title =~ s/\s\s+/ /g;
                #if it goes horribley wrong, revert back
                if( length $title == 0)
                {
                        $title = $tmp;
                }
        }
        return $title;
}


BigB.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 14, 2009 8:47 pm 
Offline
Joined: Tue Mar 22, 2005 9:18 pm
Posts: 1422
Location: Brisbane, Queensland, Australia
Yes you are right it would work, another example where this logic is problematic is Babylon AD, it drops the AD and thus finds Babylon 5 the TV series.

I can see the reasoning behind why you would like to do this, but would it be possible to do the search first with the title the way it is and then if nothing is found then do the clean search. I appreciate that this is now two searches instead of one, but at this current time I can't think of another way to cater, these instances.

_________________
Girkers


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 14, 2009 9:31 pm 
Offline
Joined: Mon Feb 06, 2006 5:11 pm
Posts: 353
Location: Brisbane, Australia
Hi All,

If anyone else has this issue, could you please post the offending example and I'll look into changing how it works.

Girkers, I'll hold off the multiple queries for now, but i might tighten up the regex.

BigB.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 18, 2009 1:55 am 
Offline
Joined: Tue Mar 22, 2005 9:18 pm
Posts: 1422
Location: Brisbane, Queensland, Australia
Multiple queries is definitely not really the way to go, just really putting it out there with no real thinking behind it. It is a difficult situation, the only other thing that comes to mind is you could ask the user if it is TV or Video. I appreciate that this would then stop the automation that this product already has and that again would not be ideal.

_________________
Girkers


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 18, 2009 10:08 am 
Offline
Joined: Thu Sep 30, 2004 12:26 pm
Posts: 468
Location: Canada
Speaking as a developer, this naming thing will always be flawed, the file name you are using is user input. And the general rule is, never trust data entered by the user. Always validate and clean it. But, there is a caveat to that rule, once you are sure there are no malicious values contained in the input that could be hacking attempts (sql injection) you have to trust the input to a certain degree. After all, it is what was entered.

It may be more calls to the sites, but the end result is a more accurate and correct execution of the script. And, it's only more calls to websites if the input needs to be cleaned. In many cases it should be correct to start with and your execution path is the normal, ideal, single call to get the information.

Edge cases where you clean up the name and call the site again, should only be attempted after the simple, ideal scenario fails to return with a match.

Ultimately accuracy is the most important goal of any computer program. Ease of use, memory and disk consumption, execution speed, etc are all just niceties that you control as best you can,without sacrificing accuracy.

To sum up, I'd code the script first along the ideal, fast, efficient case, and ensure that if the input is ideal "Movie Name.ext" that it does as little extra processing as possible for the best speed possible. But, in the circumstance where it fails to return a result, adjust the input and look for a match again, and keep adjusting and looking until you find a match, or exhaust all options. Write to a log whenever a file name fails to be found. And perhaps, also, write to a new script that could be optionally run afterward to rename files that were found after massaging the name to something that was found (I say optionally so the user can view the file and ensure those edge cases were handled correctly before execution).

Just my .02

ps. Since you write regular expressions, you may find this tool very very handy http://www.ultrapico.com/Expresso.htm

_________________
"The amount of time needed to solve a problem is inversely proportionate to the complexity of the solution" -- Me

KM: R5.5
CPU: Athlon 3800+
Vid: nvidia 7300GT
Snd: Chaintech av-710
Tuner: PVR150
HD: 1000gb sata + 750gb sata + 500gb usb


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 21, 2009 3:12 pm 
Offline
Joined: Thu Mar 08, 2007 11:13 am
Posts: 29
Location: Toronto Canada
hi BigB,
Just noticed today and haven't done much research yet but thought I would bring it up. When the script is run with no options, it writes to the database [coverfile=' '] or to say it creates a blank entry for this field where I believe the default setting is [coverfile='No Cover']. This breaks a few other things I do as I do filter by 'No Cover'. I will admit that I am not using knoppmyth currently and am unsure if the default is the same but would assume so as it is still MythTV.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 21, 2009 6:40 pm 
Offline
Joined: Mon Feb 06, 2006 5:11 pm
Posts: 353
Location: Brisbane, Australia
hi Copper0,

if 'No Cover' is the default for the video manager then i will change the script to be the same.

BigB.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 403 posts ] 
Go to page Previous  1 ... 8, 9, 10, 11, 12, 13, 14 ... 27  Next



All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu