| 
			
			 | 
		#1 | 
| 
			
			
			
			 ♫ 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 661 
				Karma: 506380 
				Join Date: Aug 2010 
				Location: Germany 
				
				
				Device: Kobo Aura / PB Lux 2 / Bookeen Frontlight / Kobo Mini / Nook Color 
				
				
				 | 
	
	
	
		
		
			
			 
				
				Author/Title sort
			 
			
			
			I wrote a little plugin that reads the metadata of books using self.db.get_metadata, then changes the values of the author and/or the title and writes the data back using self.db.set_metadata. 
		
	
		
		
		
		
		
		
		
		
		
		
	
	Everything works. What I don't get to work, how do I set author_sort and/or title_sort of my changed values? Is there a function that I can use to calculate and write them back? One more question, I also use QProgressDialog, it works, but it always shows "libprs500" in the header of the progress window. How do i get rid of this?  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#2 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				Join Date: Oct 2006 
				Location: Mumbai, India 
				
				
				Device: Various 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			dont use get/set metadata, they are very ineeficient if all you want to do is change a couple of fields. Use db.new_api.field_for('title', book_id) and db.new_api.field_for('authors') and to change, 
		
	
		
		
		
		
		
		
		
		
		
		
	
	db.new_api.set_field('title', {book_id:value}) db.new_api.set_field('authors', {book_id:value}) Then use 'title_sort' and 'author_sort' to work with those fields. ANd to set the window title use self.setWindowTitle('whatever')  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| Advert | |
| 
         | 
    
| 
			
			 | 
		#3 | 
| 
			
			
			
			 ♫ 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 661 
				Karma: 506380 
				Join Date: Aug 2010 
				Location: Germany 
				
				
				Device: Kobo Aura / PB Lux 2 / Bookeen Frontlight / Kobo Mini / Nook Color 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Thanks, I changed to the new_api method. 
		
	
		
		
		
		
		
		
		
		
		
		
	
	Seems that using that one authors_sort and title_sort are automatically updated? Much better than get/set metadata. But self.setWindowTitle('whatever') does not work. It is actually the window of the progressbar that shows the libprs500 text, no matter if I use self.setWindowTitle('whatever') or progressbarname.setWindowTitle('whatever')...  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
![]()  | 
            
        
    
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Title and Author Sort | jgt1942 | Library Management | 5 | 05-26-2014 04:59 AM | 
| Caibre - Fails to sort by Author, Title, etc | LesWilk | Devices | 1 | 03-17-2012 07:41 AM | 
| Sort by author then title | richardwarriner | Library Management | 3 | 11-16-2011 02:00 PM | 
| Author then title sort | Gary Young | Calibre | 4 | 08-30-2010 11:03 PM | 
| Sort by author AND title | bookends | Calibre | 2 | 05-09-2010 02:55 PM |