LinuxMCE Forums
May 18, 2013, 07:26:16 pm GMT-1 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Rule #1 - Be Patient - Rule #2 - Don't ask when, if you don't contribute - Rule #3 - You have coding skills - LinuxMCE's small brother is available: http://www.agocontrol.com
 
   Home   Help Search Chat Login Register  
Pages: [1]
  Print  
Author Topic: Problem when attempting to remove unused genres  (Read 841 times)
royw
Guru
****
Posts: 261


View Profile
« on: May 22, 2008, 08:14:58 pm »

Howdy,

I'm trying to clean up the list of genres that is displayed on UI2's Video, Genre menu.  My thoughts were to simply remove all of the unused  "Genre" Attributes, like:

Code:
desc "Remove unused Genre Attributes"
task(:remove_unused_genres => :environment) do
genre_attribute_type = fetch_attribute_type('Genre')
PlutoMedia::LmceAttribute.find_all_by_FK_AttributeType(genre_attribute_type.id).each do |genre_attribute|
if genre_attribute.lmce_files.empty?
puts "Deleting Genre Attribute: #{genre_attribute.Name}"
genre_attribute.destroy
end
end
end

Which does remove all of the Genre Attributes that don't have any File references.

The problem is that the Video, Genre menu now only contains the "All" entry.  I've tried regen'ing the oribiter, reloading the core/hybrid, rebooting, resynchronizing the media, adding a new attribute from the media file sync, restoring the database to it's pre-changed condition.  Nothing seems to work to get the list of Genre.

I've grep'ed in the source code and haven't found anything hinting that the menu requires anything else besides the Attribute and File tables.

I'm hoping some nice guru can point me to where I need to be looking.

Thank you,
Roy
Logged

Zaerc
Alumni
LinuxMCE God
*
Posts: 2256


Department of Redundancy Department.


View Profile
« Reply #1 on: May 22, 2008, 10:50:52 pm »

I think you can create them under "Files & Media | Edit Media file" in the web-admin.
Logged

"Change is inevitable. Progress is optional."
-- Anonymous

royw
Guru
****
Posts: 261


View Profile
« Reply #2 on: May 23, 2008, 12:52:04 am »

A little more research and I discovered that the Genre Attributes are all referenced by search_tokens table and some are also referenced by discs table.  So removing unused genres is going to be a little more involved than I originally thought...

Thank you,
Roy
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!