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

Glasswalker

  • Regular Poster
  • **
  • Posts: 20
    • View Profile
New Media Tagging System
« on: November 08, 2008, 02:17:55 am »
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 can be downloaded at: http://www.samuraipotato.com/files/Recursive_Tag.tgz

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.

Glasswalker

  • Regular Poster
  • **
  • Posts: 20
    • View Profile
Re: New Media Tagging System
« Reply #1 on: November 08, 2008, 04:05:35 am »
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.

http://www.samuraipotato.com/files/editMediaTagsRecursive.tgz

Thanks tkmedia for pointing it out!

Glasswalker

  • Regular Poster
  • **
  • Posts: 20
    • View Profile
Re: New Media Tagging System
« Reply #2 on: November 08, 2008, 04:27:26 pm »
Yet another update. This one just adds some fine tuning to the UI.

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)

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: New Media Tagging System
« Reply #3 on: November 08, 2008, 10:46:01 pm »
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?

Glasswalker

  • Regular Poster
  • **
  • Posts: 20
    • View Profile
Re: New Media Tagging System
« Reply #4 on: November 09, 2008, 01:28:28 am »
Could you doublecheck the file: /var/www/pluto-admin/operations/mediaBrowser/mainMediaFileSync.php

you should have on line 55 a javascript function doRecursive()

Also on line 93 there should be an html button named Recursive.

That file is one of the ones in the archive so if it was written correctly, those lines should be there.

That's the part of the code that displays the button and redirects the righthand pane into the recursive tagging tool.

Also /var/www/pluto-admin/operations/mediaBrowser/editMediaTagsRecursive.php should exist (extracted from the most recent update file)

If that doesn't help, can you send me a screenshot of the screens your describing so I can better see the problem?

The code works fine for me, and on the one other person I know who has tested it. But I haven't heard much feedback at all from anyone else yet, so I don't know how well it's working across the board.

I guess I should point out this was built on 0710 as well... I haven't tested on any other version yet. (although I hope for it to be included in the 0810 release).

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: New Media Tagging System
« Reply #5 on: November 09, 2008, 03:01:30 am »
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....

Can't attach files (known issue I believe), can email you if you PM me your email address...

Glasswalker

  • Regular Poster
  • **
  • Posts: 20
    • View Profile
Re: New Media Tagging System
« Reply #6 on: November 09, 2008, 04:39:31 am »
PM Sent.

Also out of curiosity who owns the files?

I know I do my development as root, so perhaps chowning them to root would make a difference?

Anywhoo email me some screenshots, and we can get it worked out :)

Thanks!

alx9r

  • Guru
  • ****
  • Posts: 187
    • View Profile
Re: New Media Tagging System
« Reply #7 on: November 18, 2008, 04:02:14 pm »
colinjones/Glasswalker,

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.

Alex

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: New Media Tagging System
« Reply #8 on: November 18, 2008, 09:14:42 pm »
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!

Col.

zug

  • Veteran
  • ***
  • Posts: 60
    • View Profile
    • High Tech Pad
Re: New Media Tagging System
« Reply #9 on: November 23, 2008, 08:55:12 pm »
When I installed it i get :

Fatal error: Call to undefined function quick_search_box() in /var/www/pluto-admin/operations/mediaBrowser/mainMediaFilesSync.php on line 79

Any ideas?
Z-Wave,  Peripherals, Licenced Media Directors and Cores now available with European-wide Delivery at www.hightechpad.com.

wombiroller

  • Guru
  • ****
  • Posts: 340
    • View Profile
Re: New Media Tagging System
« Reply #10 on: November 25, 2008, 12:05:28 am »
Works fine for me - thanks Glasswalker, a real time-saver :-)

patmankn

  • Veteran
  • ***
  • Posts: 88
    • View Profile
Re: New Media Tagging System
« Reply #11 on: November 25, 2008, 02:57:22 am »
Thanks Glasswalker.... as i am a series junkie myself ... it was a pain to tag the media properly.
Still fiddeling with your baby and still hoping i figure it out ;O)
Thanks Dude!

Patrick
Hybrid: MSI MS-7329,Nvidia 6150 onboard,AMD BE-2400,2gb RAM,Sharp Aqous LE 37X20E via MD Zotoc Ion Synergy,Terratec 1200 & Cinergy DT USB Diversity DVB-T, KNC ONE TV-Station DVB-C,WebDT366,Fiire Chief http://wiki.linuxmce.com/index.php/User:Patmankn

Zaerc

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 2256
  • Department of Redundancy Department.
    • View Profile
Re: New Media Tagging System
« Reply #12 on: November 25, 2008, 04:21:52 am »
...
I guess I should point out this was built on 0710 as well... I haven't tested on any other version yet. (although I hope for it to be included in the 0810 release).
I just shook the magic 8-ball and it said: "Signs point to yes" ;)
"Change is inevitable. Progress is optional."
-- Anonymous


Glasswalker

  • Regular Poster
  • **
  • Posts: 20
    • View Profile
Re: New Media Tagging System
« Reply #13 on: November 28, 2008, 08:45:55 pm »
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 weekend
B) 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!

Zaerc

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 2256
  • Department of Redundancy Department.
    • View Profile
Re: New Media Tagging System
« Reply #14 on: December 02, 2008, 06:49:19 pm »
...
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)
...

I've just put your changes into SVN, so they'll be included in the next update of the pluto-website-admin package.
"Change is inevitable. Progress is optional."
-- Anonymous