1. 15 Jun, 2019 1 commit
    • Meghdad's avatar
      Fix search view not hiding after hitting ESC · 77a7b409
      Meghdad authored
      The SearchView did not always hide after hitting ESC while typing
       into the SearchBar.
      The problem in general arises because the duty of toggling the search
       view was scattered in multiple files (listed below). Centralizing
       the logic into one appropriate place, makes the switching management
       easier and also fixes the core problem.
      
      The details of the problem can be described using a search scenerio
       as below:
      
      1. The user starts typing into the searchbar.
      2. The view switches to the search view upon typing the first searchable
       character.
      3. The logic to set the previous view of the search view is not going
       to be kicked until the search engine actually starts the query and
       the search view begins adding found items.
      4. The engine has queried the db.At this point, the user hits ESC,
       and the _search.props.search_mode_active becomes false in Window.py.
      5. That in turn calls SearchView.search_mode_active.setter which sets
       search_state to None. Again this activates the
       Window._on_search_state_changed handler that makes the switch to the
       previous view.
      6. Now, because the search is in progress in the background,
       the search_state and the previous_view are being set constantly which,
       the former keeps triggering the Window._on_search_state_changed handler
       and the latter is now set to the new previous view (search view). So
       the view returns back to the search view.
      7. Other than that, SearchBar.py keeps switching to the search view as
       long as the timer is active.
      
      To fix the problem, take the responsibility to switch the search view out
       of those areas and place them into the Window.py which has the knowledge
       of the state of the search and related views and as the main container
       also has the resonsibility to decide what views should be shown and when.
      
      This fix does not deal with the issue of ongoing background search.
      
      The following changes were made as part of the fix:
      
      -Changes in Window.py:
      
      Modifty the private function Window.on_search_state_changed()
       such that it takes the responsibility of switching the views after
       the search state changes.
      
      Add a listener function to Window called _on_search_mode_active_changed
       that takes the responsibility of disabling and enabling
       the search view and switching to the previous view by holding the
       previous view in a new field: view_before_search.
      
      Modify the Window._on_key_press() function such that
       upon entering search characters or pressing ESC, the
       search.props.search_mode_active is toggled.
      
      -Changes in SearchBar.py:
      
      Remove the search view switching logic from
       SearchBar._search_state_changed() so that only the Window object is
       concerned with it.
      
      -Changes in SearchView.py:
      
      Remove the block of code from the SearchView._add_item() function that
       deals with setting the previous_view field. The field is set by the
       Window object instead.
       To prevent a loop that can be caused by setting
       the search_mode_active property, add a check to the same setter to
       prevent unnecessarily setting the search_state property.
      
      Remove prev_view field, because it is no longer needed.
      
      Closes: #141
      77a7b409
  2. 14 Jun, 2019 1 commit
  3. 11 Jun, 2019 1 commit
  4. 07 Jun, 2019 2 commits
  5. 05 Jun, 2019 2 commits
  6. 03 Jun, 2019 3 commits
    • Jean Felder's avatar
      mpris: Fix interface name in _on_playlist_renamed · 461a9e1b
      Jean Felder authored
      This regression was introduced by commit
      a7c6ce8e.
      461a9e1b
    • Jean Felder's avatar
      mpris: Untangle MPRIS and playertoolbar · 9ba2d6bf
      Jean Felder authored
      MPRIS is tied with PlayerToolbar because the thumbnail updating logic
      takes place in the CoverStack from PlayerToolbar.
      In fact, on every song change the following thing happens:
      * PlayerToolbar looks up for the song's thumbnail (via its
        cover_stack) and emits a "thumbnail-updated" signal once the
        operation is finished.
      * MPRIS sends the song's metadata without the thumbnail url (it has
        not been updated yet). A bit later, once the "thumbnail-updated"
        signal is received, the metadata are sent again with the correct
        thumbnail url.
      This can result in a glitter on some MPRIS clients: the client is
      updated with an empty thumbnail, and then, very quickly, with the
      correct one.
      
      Fix that issue by factoring out the thumbnail cache lookup and
      directly looking up the song thumbnail from MPRIS. The disadvantage of
      this solution is that the lookup_art_file_from_cache function is
      called two times on a song change. One call from PlayerToolbar and the
      other one from mpris. However, this function call is less costy than
      sending two times the song's metadata.
      
      Related: #43, #172
      Closes: #101
      9ba2d6bf
    • Jean Felder's avatar
      albumartcache: Remove unused attribute · 5db215e5
      Jean Felder authored
      5db215e5
  7. 02 Jun, 2019 1 commit
  8. 01 Jun, 2019 2 commits
    • Jean Felder's avatar
      flatpak: Remove access to host cache for media art · a9715abf
      Jean Felder authored and Jean Felder's avatar Jean Felder committed
      When the flatpak application has access to the host cache media art,
      it is able to load the media art from host cache and display it in all
      the views and widgets. However, the URI passed to the MPRIS client is
      the container's one. Therefore, the MPRIS client try to load an uri
      which does not exist.
      
      Fix the issue by removing the host xdg-cache/media-art access. This
      means that the flatpak application does not use the system cache and
      creates its own.
      
      Closes: #253
      a9715abf
    • Balázs Úr's avatar
      Update Hungarian translation · 4e95b6b5
      Balázs Úr authored and Administrator's avatar Administrator committed
      4e95b6b5
  9. 31 May, 2019 10 commits
  10. 30 May, 2019 3 commits
    • Jean Felder's avatar
      query: Retrieve last_played key · e56bb27e
      Jean Felder authored
      This key is used by the metadata property of MPRIS.
      e56bb27e
    • Marinus Schraal's avatar
      meson: Bump Grilo dep to 0.3.8 for annotation fix · a8804ed8
      Marinus Schraal authored
      Grilo get_last_played was incorrectly annotated for the introspection
      bindings, resulting in hard to track problems over the years. With grilo!37
      these are now hopefully a blast from the past.
      
      Fixes: #131,#286
      a8804ed8
    • Jean Felder's avatar
      mpris: Fix lastUsed metadata · c47328b8
      Jean Felder authored
      Commit 39608d44 highlighted a bug which was never triggered before:
      the lastUsed metadata is badly formatted. Indeed, the last_played
      method of Grl.Media returns a GLib.DateTime. This date needs to be
      formatted into a string in order to be used by MPRIS.
      This bug had never been encountered because of the presence of a
      try/except block.
      
      Fix the issue by formatting the date into a string in ISO 8601
      format.
      
      Closes: #294
      c47328b8
  11. 29 May, 2019 11 commits
  12. 27 May, 2019 3 commits