zwieberl / harbour-fishtheke

mediathekviewweb-client for SailfishOS
Other
6 stars 4 forks source link

Clear search results when doing new search #6

Closed Pohli closed 5 years ago

Pohli commented 5 years ago

To keep old search results is irritating. Who would expect that when doing a new search?

Jolla Phone with SFOS 3.0.0.8, Fishtheke 0.3

zwieberl commented 5 years ago

Could you elaborate a bit what you mean? I'm not quite sure I understand the issue.

When you move from the results-page "back" (left) to the search-page, results are cleared. If you move right again, without changing your search-filters, you will probably get the same results again, but they are newly fetched from the web. When you select an item for detailed view and move back, the old results are still there, but that is intentionally.

Pohli commented 5 years ago

Results are not cleared when going back from results page and performing a new search. To see new results I have to scroll down on results page and tap "Load more". Someone wrote about same issue at the store comments.

zwieberl commented 5 years ago

This is very weird. I can not reproduce this at all. Could you please write a step by step description of what it is you are doing? Here is my test:

  1. Start Fishtheke
  2. Decrease "items per search" to 3
  3. Add a filter for "channel" ARD
  4. Swipe right to search => 3 ARD items listed
  5. Swipe left to get back
  6. Remove ARD-filter.
  7. Add ZDF-filter.
  8. Swipe right to search => 3 ZDF items listed

I tested this with the development emulator from Jolla and my Xperia-device.

Pohli commented 5 years ago

I exactly performed your test. At step 8 there were still the ARD results listed, only.

  1. I pulled up "Show more". 3 new ZDF results are added to the list.
zwieberl commented 5 years ago

Very strange. Maybe Jolla changed the API between SailfishX and Jolla Phone. It works with SDK provided by Jolla, so I assumed it works "everywhere". Will try to find out whats behind this.

zwieberl commented 5 years ago

I might have found the problem. Unfortunately, I can't test it. How tech-savvy are you? Do you have developer-tools enabled? If so, could you edit the file /usr/share/harbour-fishtheke/qml/pages/ResultsPage.qml

Find

     onStatusChanged: {
       if (status == PageStatus.Deactivating
               && (_navigation == PageNavigation.Back || _navigationPending == PageNavigation.Back)) {
             datafetcher.reset()
         }
    }

and replace it with

     onStatusChanged: {
        if (status == PageStatus.Deactivating && pageStack.depth === 1) {
            datafetcher.reset()
        }
    }

to see if the issue is still there.

If you can't (or don't want to) do this, I will commit it and release it with the next update. Hopefully, it is gone by then

Edit: Changed pageStack.depth === 2 to pageStack.depth === 1, because current harbour-version has one page less.

zwieberl commented 5 years ago

Note: Github closed this ticket automatically because of my commit. Please reopen it, if this issue persists!

Pohli commented 5 years ago

Tech-savvy: medium Developer tools: enabled So I only have to edit that file? No need to compile anything? (looks like source code)

zwieberl commented 5 years ago

Yes, for these kinds of files (QML), there is no need to recompile. Just edit and (re)start the app. But I made (yet) another small mistake: It should read pageStack.depth === 1 for the version currently on harbour. I added a new page in my development version here and forgot to adjust.

Pohli commented 5 years ago

I just tried your manual patch but now I can't tap the Search "button" any more. That blurred spot in the upper right corner indicating to tap there to do the Search is also gone.

zwieberl commented 5 years ago

Right on start or after the first search? If right on start: maybe you missed a bracket or something? I submitted a new version containing the "fix" to harbour today. Hopefully tomorrow it will be released. My suggestion: just wait for the update and get back to me if it now works or not, ok? Thank you for sticking with me on this. Writing code for hardware you can't test on sucks.

Pohli commented 5 years ago

You had a good guess! I checked and found one closing bracket too many in the snippet you posted above compared to the original file. Before I just copy-pasted your snippet but then I've removed one bracket and it works now. Thanks alot!

zwieberl commented 5 years ago

Sorry about that! But cool it works now. Hopefully it will work with the "official" update as well ;-)

Pohli commented 5 years ago

Updated from Jolla store and tested successfully! :-)

zwieberl commented 5 years ago

Great! Thank you very much for reporting this. If any new problems arise, please open more bugreports. I don't own a Jollaphone and thus can neither test nor discover bugs specific to this device.