curtwagner1984 / YAPO

Yapo - Yet Another Porn Organizer
GNU General Public License v3.0
48 stars 10 forks source link

[Bug] Search and Sorting is broken #54

Open HansMaulwurf2 opened 7 years ago

HansMaulwurf2 commented 7 years ago

The search and sort fields in all sections are not filled with any data and therefore not usable. See attached screenshot.

2016-12-12 20_38_03-yapo_

I've been digging through the code and I think I have identified the responsible code section: In "YAPO\videos\static\js\app\section-list-wrapper\section-list-wrapper.component.js" the "self.sectionType" is undefined when choosing the data to populate the fields. One solution would be to do all that in the "mainPageInit" function and NOT call it again. It would look like this:

self.mainPageInit = function () {
                    scopeWatchService.sortOrderChanged({
                        'sectionType': self.sectionType,
                        'sortBy': self.sortBy,
                        'mainPage': self.mainPage
                    });
                  if (self.sectionType == 'ActorList') {
                    self.orderFields = actorOrderFields;
                    self.searchInFields = actorSearchInFields;
                    $rootScope.title = "Actors";
                    self.sortBy = getSortBy('ActorList');
                  } else if (self.sectionType == 'SceneList') {

and so on...

That fixes it in my test environment. I don't understand the code base well enough to know if that breaks anything else though. It should be done by somebody who knows what he is doing. :)

Regards

curtwagner1984 commented 7 years ago

Hey, it would be great if you play around with it and see if it actually breaks something. If it doesn't just create a pull request and I'll add your fix.