cjcodeproj / medialibrary

Python code to read XML media files
MIT License
2 stars 0 forks source link

POC tool castlist is improperly sorting movie titles #172

Open cjcodeproj opened 6 months ago

cjcodeproj commented 6 months ago

The POC tool media.tools.movies.castlist builds a list of movies for a given actor, sorted out.

Ex.

Gary Riley                     Planes, Trains And Automobiles Motel Thief                   
                               Ruthless People                Heavy Metal Kid               
Kurt Russell                   Breakdown                      Jeff Taylor                   
                               Deepwater Horizon              Jimmy Harrell                 
                               Escape From L.A.               Bob 'Snake' Plissken          
                               Executive Decision             David Grant                   
                               The Fate Of The Furious        Mr. Nobody                    
                               Guardians Of The Galaxy Vol 2  Ego                           
                               The Mean Season                Malcom Anderson               
                               Once Upon A Time In Hollywood  Randy Miller                  
                               Swing Shift                    'Lucky' Lockhart              
                               Tango & Cash                   Gabriel Cash                  
                               Tequila Sunrise                Nick Frescia                  
                               The Thing                      MacReady                      
                               Vanilla Sky                    McCabe                        

Unfortunately, the sort operation is a simple comparison based on the unique_key value, which isn't going to be as accurate.

This ticket needs to address two issues.

  1. The media.data.media.contents.movie.Movie class should not have __gt__, or __lt__ methods.
  2. There should be a function somewhere in the sorting code that easily generates a list of movies in title order using the new sorting frameworks. It should take a list of movie objects as an argument, and should return those same movie objects in title alphabetical order.

Related tickets.

https://github.com/cjcodeproj/medialibrary/issues/76 https://github.com/cjcodeproj/medialibrary/issues/148