Author
Topic: New Media Tagging System (Read 5748 times)

Hey everyone, I figured I would make my first stab at contributing to the LMCE codebase... So I developed a new addition to the media tagging functionality within the web admin.

I know everyone finds it painful to tag each item individually, and there is no easy solution for TV Episodes... So I wrote a new system to handle that.

Basically it integrates to the media file sync screen, when your browsing a folder, you will see a button labeled "Apply These Tags Recursively". That lets you access the new system.

How this is meant to be used:- First Put your media inside a folder structure of some kind. In my case, for TV Episodes for example I store it in TV/Showname/SeasonX/Filename.avi- Also it helps alot if your files have a standard file naming convention, most downloaded packs do, but be careful if it's a mixed bag.- Now you browse to (in the case of my example) the "Showname" directory.- Now apply any tags that apply to the entire show (or use the search amazon function)- Now click the Apply Recursively button. This allows you to copy these tags onto every file/folder contained within this one (fullly recursive)- Once in the recursive screen, choose if you want it to apply to files, folders, or both.- Also if you want to tag TV episodes automatically by their filename, check out the TV Episode Tagging Mode.- Now click the "Confirm" button and see a sample of what it will affect. If there are any problems it will tell you here.- Click the final approve button and it will go nuts tagging your files.- Just because I target TV Episodes doesn't mean it can't be used for other types of media. The recursive tagger will recursively tag anything- (it's just the file parsing tagger that's specific to tv episodes)- This will recursively duplicate all attributes, long attributes, and images.

Some things to consider:- IT WILL OVERWRITE ANY TAGS YOU HAVE! so please be careful where you use it.- It is not 100% tested yet, there may be bugs.- The tv series renamer is designed only for tv series (but since these are all that is really lacking in LMCE I thought that's fine)

Notes about the TV Episode Tagger:- It is flexible. It can handle any case where files are uniformly named - Example: S01E02 - Some Title [[HDTV-LOL]] or something like that.- As long as the following conditions are met:- Season number, and episode number must be fixed length (If you use 2 digits, it must be 2 digit everywhere, so 1 will be 01)- Season and episode number must come before the title in the filename (but their order is not important)- If those criteria are met, it should be able to glean the season number, episode number, and title from the filename.- You can use the strip text field to rip off group tags like the [[HDTV-LOL]] in the example.- It supports adding more than one strip text, so you can strip wierd file formats, or rip garbage out.- Get creative with customizing the settings, and let me know how it works. I'm open to suggestions.

The file is relative to the /var/www directory on the core. Extract it SOMEWHERE ELSE and make BACKUPS of your originals, then overwrite them with these.Or you can search for PAUL MUMBY in the code, for comments which mark modifications made by me. And patch it in yourself.I'm talking to the devs about getting this merged into the LMCE distro so you don't need to manually install it.

That's about it. I hope everyone enjoys! (if someone gets a chance, post some screenshots or more details install instructions, I haven't got time right now lol)

Shameless plug for my home business goes here: http://www.proswords.com/ (if your interested let me know you came from LMCE for a 10% discount!)

Let me know if you have any problems, bugs, suggestions, or questions.

Ok, I was notified of a bug. Apparently I didn't escape my strings before running SQL queries... Please extract this tarball, and overwrite the editMediaTagsRecursive.php in the original archive I posted. This should correct the problem.

Added back buttons throughout so that you can navigate a little smoother.Also added a sample file listing to the first page so it is simpler to figure out the name parser settings for doing the tv episode tagging.

Just overwrote the same file as the last patch, so see my last post for the link to the updated file. (just re-download it and overwrite)

hmmmm.... when I did the initial update I did seem to have the new button (but couldn't test it at that time). I have just checked again, but now my entire righ pane is empty... just an up-one-level link and a search field. In between these two experiences I did apply the first update, and have just applied the most recent update and that hasn't made any difference. I'm pretty sure I replaced the files exactly as instructed.... has anyone else seen this?

hmm... strange, yes both the function and button are in that file and the other (new) file exists as it should. Looking at other phps in that directory there is a mixture of ones that do not have execute permissions set and others that do. These files do not, but as other files there also do not and those have never been touched, they are the normal 0710 files I assume that this has nothing to do with it....

From the last couple posts, it seems like there was an outstanding issue (permissions?) that was preventing colinjones from using the script. I'm interested in trying this script out but was wondering if colinjones (or anyone) did indeed successfully get the script working on his machine in the end.

blah blah - just ignore me.... no idea what I did (didn't get around to refreshing the files yet) but it seems it is only a problem on IE on XP. When I do it from Firefox on the core, it works fine. So it isn't the work glasswalker did, it was me screwing something up I guess!

lmao been busy as hell at work lately, haven't had a chance to check this thread. (subscribing to email notices now so I can respond to people's questions lol)

anyway, Zug, when you say your getting that error, can you provide more info about your environment? (what version of lmce, how did you install, specificially how did you install it step by step)

Also Zaerc: Awesome! I'm glad to hear it will get merged into the tree eventually (provided 0810 doesn't drive you into total insanity first lol)

One note, please contact me before doing merges. There is an outstanding issues regarding flac audio files, apparently it corrupts the metadata for them when it encounters them. Tkmedia has been battling with it for some time. I haven't had time to try and fix it yet. I hope to try and either:A) Get this fixed this weekendB) Put in a bandaid (skip processing of flac files) until I get time to fix it proper...

So want to make sure this fix makes it into the main code then.

Thanks for your feedback everyone! I'm glad this is getting some good use!