Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add podcast support #875

Merged
merged 69 commits into from
Aug 20, 2021
Merged

Add podcast support #875

merged 69 commits into from
Aug 20, 2021

Commits on Jul 29, 2021

  1. Draft an API and a mock-up back-end for the podcasts

    For now, the back-end is just able to return two hard-coded podcast
    channels when all the channels are requested. Everything else is "TODO".
    paulijar committed Jul 29, 2021
    Configuration menu
    Copy the full SHA
    1f3255b View commit details
    Browse the repository at this point in the history
  2. First draft of the Podcasts view

    The view can show the podcast channels and episoded provided by the
    back-end but cannot play them yet. The file podcastsviewcontroller.js
    still contains a lot of copy-pasted code from the
    albumsviewcontroller.js which should be refitted or removed.
    paulijar committed Jul 29, 2021
    Configuration menu
    Copy the full SHA
    ba3cc50 View commit details
    Browse the repository at this point in the history
  3. Fix podcast channel titles not showing up completely

    The listheading widget was being rendered incorrectly in case the
    element had no details button enabled.
    paulijar committed Jul 29, 2021
    Configuration menu
    Copy the full SHA
    436d77e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    bffd406 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    6112c49 View commit details
    Browse the repository at this point in the history
  6. Proper information for podcasts in the player control bar and popups

    The podcast episode, channnel, and image are now properly shown in the
    player control bar, in the mediaSession integration, and in the desktop
    notification.
    paulijar committed Jul 29, 2021
    Configuration menu
    Copy the full SHA
    81c9612 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    08e1d68 View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2021

  1. DB tables, entities, mappers, and business layers for podcasts

    All these new classes and definitions are not yet used for anything.
    paulijar committed Aug 1, 2021
    Configuration menu
    Copy the full SHA
    b779869 View commit details
    Browse the repository at this point in the history
  2. Enable populating and clearing the podcast tables with occ

    The `occ` command `music:podcast-add` can now be used to add a single podcast
    channel from a RSS feed and the command `music:podcast-reset` can be used to
    reset all the previously added channels along with their episodes.
    paulijar committed Aug 1, 2021
    Configuration menu
    Copy the full SHA
    a7c6bd2 View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2021

  1. Proper implementation for the API method getting the podcasts

    Get the data from the database tables instead of fetching it on the fly from
    a few hard-coded RSS feed URLs.
    paulijar committed Aug 2, 2021
    Configuration menu
    Copy the full SHA
    aadd77c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7fe7451 View commit details
    Browse the repository at this point in the history
  3. Implement the rest of the previously drafted podcast REST API

    Implemented REST API endpoints to subscribe to a podcast channel, to
    unsubscribe it, to get an individual podcast channel and to reset all the
    subscribed channels.
    paulijar committed Aug 2, 2021
    Configuration menu
    Copy the full SHA
    fe61f9c View commit details
    Browse the repository at this point in the history
  4. Include channel_id into the unique index of the episodes DB table

    It is at least theoretically possible that there would we identical podcast
    channels with differing RSS feed URLs. In such case, we should allow
    duplicate episode `guid`s to exist.
    paulijar committed Aug 2, 2021
    Configuration menu
    Copy the full SHA
    226c8e0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    6fb3861 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    ce9f148 View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2021

  1. Configuration menu
    Copy the full SHA
    8f4c224 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f9d8eba View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2021

  1. Add an option on the web UI to update all the podcast channels

    As part of this change, a new module podcstService was created to host
    the new functions. Also the handling of the creating/subscribing a new
    podcast channel was moved from navigationController to this new service.
    paulijar committed Aug 4, 2021
    Configuration menu
    Copy the full SHA
    872961c View commit details
    Browse the repository at this point in the history

Commits on Aug 5, 2021

  1. Web UI options for reloading and removing an individual podcast channel

    To achieve this, a support had to be added to the listHeading directive
    to attach an actions menu. The menu contents are injected when
    instantiating the directive.
    paulijar committed Aug 5, 2021
    Configuration menu
    Copy the full SHA
    f026eea View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    95c51fe View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    be9b06d View commit details
    Browse the repository at this point in the history
  4. Fix the operation of the inViewObserver when a new podcast channel added

    The new instance used to be always appended to the end of all instances
    although often this was not the correct place, according the order of
    the elements on the UI. Hence, the lazy loading didn't work correctly
    before reinitializing the view by navigating to another view and back.
    paulijar committed Aug 5, 2021
    Configuration menu
    Copy the full SHA
    b8b1798 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    6c03bad View commit details
    Browse the repository at this point in the history
  6. Do not parse channel lastBuildDate or include it in the channel hash

    On some podcast channels, the <lastBuildDate> tag changes very often,
    e.g. once every 15 minutes. This caused a lot of unnecessary updates on
    the database contents with such channels.
    paulijar committed Aug 5, 2021
    Configuration menu
    Copy the full SHA
    427590a View commit details
    Browse the repository at this point in the history
  7. Improvements on the occ music:podcast-add command

    - The command now supports defining multiple RSS feed URLs at once
    
    - When adding a feed for multiple users, the feed is now fetched and
      parsed only once, and not separately for each user
    paulijar committed Aug 5, 2021
    Configuration menu
    Copy the full SHA
    7b8be7c View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2021

  1. Move the core parts of logic from PodcastApiController to PodcastService

    This facilitates code reuse when adding the podcast support for the
    Subsonic and Ampache APIs: The class PodcastService contains
    API-agnostic logic while PodcastApiController is just a thin wrapper
    for it, providing the adaptation to the REST API provided for the web
    UI.
    paulijar committed Aug 6, 2021
    Configuration menu
    Copy the full SHA
    234574d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fa64769 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    69f31f7 View commit details
    Browse the repository at this point in the history
  4. Move Subsonic API converters to PodcastChannel and PodcastEpisode

    The entity classes PodcastChannel and PodcastEpisode now have functions
    called toSubsonicApi. These replace the former functions
    SubsonicController::podcastChannelToApi and
    SubsonicController::podcastChannelToApi. Similar design was previously
    applied to the Ampache API conversion of the podcast entity types. The
    target of this refactoring is to reduce the size of the monolithic
    SubsonicController.
    
    Similar refactoring should be eventually made to the other entity
    types, too, but that does not belong under this feature branch.
    paulijar committed Aug 6, 2021
    Configuration menu
    Copy the full SHA
    af69100 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    6732c46 View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2021

  1. Fix a problem in the albums compact layout caused by f026eea

    After setting the position of the <h2> element as 'relative', also the
    position of the neighboring .albumart element must be 'relative'.
    Otherwise, the padding of the <h2> will shadow the .albumart element,
    making it impossible for the element to receive hover and click events.
    paulijar committed Aug 7, 2021
    Configuration menu
    Copy the full SHA
    72964ba View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5e3bb11 View commit details
    Browse the repository at this point in the history
  3. Ampache/Subsonic: Support starring/flagging also podcasts and episodes

    - The Subsonic API specification doesn't mention anything about
      starring with podcasts, but at least DSub and Ultrasonic allow
      starring podcast episodes and that seems to work with the official
      Subsonic demo server. Our implementation now supports starring also
      podcast channels, although no known client does that.
    
    - The Ampache API specification defines flagging support for both
      podcast channels and episodes, and this is now implemented
    
    - The Ampache API specification does not define support for podcasts on
      the action `stats` which can be used, among other things, to fetch the
      flagged entities. However, we support the types `podcast` and
      `podcast_episode` also here, as an extension to the specified API.
    
    - The property `flag` was added to all Ampache results containing
      flaggable entities. This has probably been added to the spec in some
      4.x version.
    paulijar committed Aug 7, 2021
    Configuration menu
    Copy the full SHA
    da27953 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    81a57ab View commit details
    Browse the repository at this point in the history
  5. Subsonic: Enable use of bookmarks also with podcast episodes

    Note: This change required incompatible changes on the database table
    `oc_music_bookmarks`. Hence, all previous bookmarks need to be dropped
    when updating the application.
    paulijar committed Aug 7, 2021
    Configuration menu
    Copy the full SHA
    426725b View commit details
    Browse the repository at this point in the history

Commits on Aug 8, 2021

  1. Configuration menu
    Copy the full SHA
    9814c8a View commit details
    Browse the repository at this point in the history
  2. Subsonic: Include properties suffix and bitRate on podcast episodes

    These pieces of information are not directly available in the RSS feed
    but they can usually be evaluated from the available information. The
    major motivator for this improvement was that the Jamstash client
    depends on the `suffix` field to be able to play the episode at all.
    Also, Ultrasonic client showed an ugly looking "-1 kbps" on each
    episode while there was no bitRate available.
    paulijar committed Aug 8, 2021
    Configuration menu
    Copy the full SHA
    5eb2d31 View commit details
    Browse the repository at this point in the history
  3. Add command occ music:podcast-update

    The command may be used to refresh podcasts of one or several users
    from their respective sources.
    paulijar committed Aug 8, 2021
    Configuration menu
    Copy the full SHA
    3536c92 View commit details
    Browse the repository at this point in the history
  4. Option to podcast-update to only target channels not recently checked

    Giving the option `--older-than=<HOURS>` for `occ music:podcast-update`
    has the effect of skipping all channels which have been checked for
    updates within the last <HOURS> hours. The <HOURS> may be a floating
    point value, allowing sub-hour resolution.
    paulijar committed Aug 8, 2021
    Configuration menu
    Copy the full SHA
    fb8d759 View commit details
    Browse the repository at this point in the history
  5. Smalltime fixes and cleanup

    - Null-coalescing operator doesn't work with method calls, we would
      need the null-safe operator ?-> but that comes only with PHP8.0
    
    -  Parameter default value was forgotten from
      PodcastService::updateAllChannels
    
    - Added more type declarations to CoverHelper and removed the
      type-hinting from the method ::getHashKey as that confused
      Scrutinizer (the tool assumed that type-hinting is somehow enforced,
      and the `else` branch on argument type checking would be dead code)
    paulijar committed Aug 8, 2021
    Configuration menu
    Copy the full SHA
    3917cde View commit details
    Browse the repository at this point in the history
  6. Check podcast channels for updates in the background job

    By default, each channel is checked for updates every 24 hours. This
    interval may be altered by setting another value in config.php with the
    key `music.podcast_auto_update_interval`. The automatic checking may
    also be disabled altogether by setting a negative value for the
    previously mentioned key.
    paulijar committed Aug 8, 2021
    Configuration menu
    Copy the full SHA
    37128be View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    4795642 View commit details
    Browse the repository at this point in the history

Commits on Aug 13, 2021

  1. Configuration menu
    Copy the full SHA
    066f777 View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2021

  1. Extract a reusable directive collapsible-html

    This same piece of logic, truncating a long HTML description and expanding it
    on click, was repeated three times in the various details templates. Now it
    is a reusable directive which opens the road to apply it also on the podcast
    descriptions (which is not done yet).
    paulijar committed Aug 14, 2021
    Configuration menu
    Copy the full SHA
    3a9a52d View commit details
    Browse the repository at this point in the history
  2. Truncate long podcast descriptions by default

    The full description may be viewed by clicking the truncated description.
    paulijar committed Aug 14, 2021
    Configuration menu
    Copy the full SHA
    30025c6 View commit details
    Browse the repository at this point in the history
  3. Add option --force for the command occ music:podcast-update

    The option may be give to force the updating of the episodes of all the
    targeted podcast channels, even when the podcast feed has not changed at all
    since the previous update. This may be desirable during the development when
    the parsing of the feed is changed by any means. It might be useful for the
    end-user, too, in case the database update somehow got unexpectedly aborted
    during the previous attempt.
    paulijar committed Aug 14, 2021
    Configuration menu
    Copy the full SHA
    b0b11f0 View commit details
    Browse the repository at this point in the history
  4. Show episode (and season) number on the podcast episodes

    - Extract also the season number from the podcast feed if available
    
    - The episode number is shown in the Podcasts view for each episode where
      available. If there is also a season number, the episode number is prefixed
      with it like "season-episode", e.g. "3-14.".
    
    - Sometimes also the title field in the RSS field contains the episode
      numbers. If the same number is present separately and as part of the title,
      then attempt to strip it off the title.
    
    - The season number was added to the episode details pane, too
    
    - The episode number was added to the Subsonic responses as property `track`.
      According to the Subsonic XML schema, the podcast episodes may contain all
      the same properties as the "normal" audio tracks. However, the tested
      clients (DSub and Ultrasonic) didn't seem to show the `track` property on
      episodes.
    paulijar committed Aug 14, 2021
    Configuration menu
    Copy the full SHA
    0767244 View commit details
    Browse the repository at this point in the history
  5. Add podcast episodes to DB in chronological order

    When subscribing to a podcast channel, add the available episodes to the DB
    in reverse order compared to the order of the RSS feed. Typically, the most
    recent episode is the first in the list, so this means adding the episodes
    from oldest to newest. Then, when new episodes are published, they will
    obviously be added after the first patch of the episodes, maintaining the
    same "oldest to newest" logic. Then, when returning the episodes through the
    REST API, the list is reversed once more to get the newest episodes first.
    paulijar committed Aug 14, 2021
    Configuration menu
    Copy the full SHA
    d2c9c47 View commit details
    Browse the repository at this point in the history
  6. Fix play icon not showing on playing podcast episode after 066f777

    The play (or pause) icon was not shown in the episode list on the Podcasts
    view in front of the currently playing (or paused) episode.
    paulijar committed Aug 14, 2021
    Configuration menu
    Copy the full SHA
    d8f3509 View commit details
    Browse the repository at this point in the history
  7. Fix quite a few DB columns in podcast tables being accidentally "not …

    …null"
    
    Many columns were accidentally marked as "not null" although they may quite
    well be missing in the RSS feed. This didn't break the application because
    the implementation details in the BusinessLayer were such that empty strings
    got stored instead of null values.
    paulijar committed Aug 14, 2021
    Configuration menu
    Copy the full SHA
    77b4414 View commit details
    Browse the repository at this point in the history
  8. Fix some issues detected by Scrutinizer

    The`occ music:podcast-add` was actually totally broken because of a
    copy-paste error.
    paulijar committed Aug 14, 2021
    Configuration menu
    Copy the full SHA
    289482e View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2021

  1. Enable playing all podcasts with the play icon on navigation pane

    This is probably rarely useful but should be there for consistency of the UX
    with all the other views.
    paulijar committed Aug 15, 2021
    Configuration menu
    Copy the full SHA
    79ed12e View commit details
    Browse the repository at this point in the history
  2. When playing a whole podcast channel, enqueue the episodes chronologi…

    …cally
    
    When clicking the title or image of a podcast channel, the contained episodes
    are now enqueue to the play queue in chronological order. That is, they are
    played from bottom to top.
    paulijar committed Aug 15, 2021
    Configuration menu
    Copy the full SHA
    fcfa7e8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    100fb85 View commit details
    Browse the repository at this point in the history
  4. Subsonic: Support method getNewestPodcasts

    It's not quite clear if this method should return the episodes according to
    their original publish dates or by the order in which they have been added to
    the database. Now it's doing the latter which was a bit easier to achieve.
    
    The Subsonic API version has been bumbed to 1.13.0 to advertise the
    availability of this method; at least DSub uses only methods belonging to the
    claimed API version. The other new methods from v1.12.0 and 1.13.0 are
    `getTopSongs`, `getPlayQueue`, and `savePlayQueue`, which have been stubbed
    for now.
    paulijar committed Aug 15, 2021
    Configuration menu
    Copy the full SHA
    8c58bb7 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    506fb18 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    bd5aec3 View commit details
    Browse the repository at this point in the history
  7. Fix potential mix-up on the web UI between track and podcast episode IDs

    There's no technical reason, why there couldn't be collisions between
    track IDs and podcast episode IDs. This has to be taken into account
    when evaluating if a track should be visualized as the "current track"
    or not.
    paulijar committed Aug 15, 2021
    Configuration menu
    Copy the full SHA
    90f87c0 View commit details
    Browse the repository at this point in the history

Commits on Aug 16, 2021

  1. Configuration menu
    Copy the full SHA
    33d4151 View commit details
    Browse the repository at this point in the history

Commits on Aug 17, 2021

  1. Fix the layout of the podcast channel actions menu on ownCloud

    NC core provides suitable styling for this but OC core does not. Hence,
    we need to define the style on our own. The correct kind of styling
    already existed in style-navigation.css but that was applied only
    within the actions menu. These style definitions were now moved to
    their own file style-actions-menu.css, and they were made to apply both
    on the navigation pane and elsewhere within the Music app.
    paulijar committed Aug 17, 2021
    Configuration menu
    Copy the full SHA
    9734d10 View commit details
    Browse the repository at this point in the history
  2. Prevent clicking of "Reload channels" when it's disabled

    Previously, while there were no podcast channels, the actions menu item
    "Reload channels" only appeared disabled but it could actually be
    clicked. This triggered a toast with text "All channels were already
    up-to-date".
    paulijar committed Aug 17, 2021
    Configuration menu
    Copy the full SHA
    fd18a42 View commit details
    Browse the repository at this point in the history
  3. Add loading spinner to the podcast details pane

    Shown while waiting for the contents for the pane.
    paulijar committed Aug 17, 2021
    Configuration menu
    Copy the full SHA
    adbd252 View commit details
    Browse the repository at this point in the history
  4. Fix flickering on the details pane

    When the details pane (for any content type) was closed and then opened
    again for any content type requiring closing, there was a flicker when
    the previous content was visible on the screen for a fraction of a
    second before being replaced by the loading spinner. This was visible
    at least when opening details pane for a podcast channel/episode, a
    track, or an album.
    paulijar committed Aug 17, 2021
    Configuration menu
    Copy the full SHA
    1db3523 View commit details
    Browse the repository at this point in the history

Commits on Aug 18, 2021

  1. When updating/deleting a channel, show a load spinner next to its title

    Also, when creating the first channel, there is now a loading spinner
    shown in the view.
    
    To facilitate all this, all methods of PodcastService were modified to
    return promises. This replaced signaling via $rootScope.$emit which
    was really designed only to be used when triggering operations from the
    navigation pane actions menu.
    paulijar committed Aug 18, 2021
    Configuration menu
    Copy the full SHA
    2abc0b2 View commit details
    Browse the repository at this point in the history

Commits on Aug 19, 2021

  1. Ampache: Use ISO 8601 format for all podcast timestamps

    The same format is used also on the response of the Ampache action
    `handshake`. The example responses in the Ampache API documentation
    actually use the American format like "08/19/21 22:53 PM" but I hope
    that this is just an error in the spec and/or in Ampache SW since using
    ambiguous format like that in any API makes no sense.
    paulijar committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    baf035a View commit details
    Browse the repository at this point in the history
  2. Extract and store lastBuildDate from podcasts after all

    This timestamp is part of the specified Ampache podcast responses so we
    need it after all. It is now also included in the channel details shown
    on the web UI. This field is still excluded when judging if the RSS
    feed has actually changed after the previous podcast update (because on
    some channels, the lastBuildDate changes very ofter without any other
    changes). This means that if only the lastBuildDate is updated in the
    feed, then the user will not see this even with manual update from the
    UI.
    paulijar committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    ba6bd9f View commit details
    Browse the repository at this point in the history
  3. Better handling for occ music:podcast-update --force

    The `--force` flag now forces an update also on the data stored in the
    oc_music_podcast_channels table. Previously, the forcing was applied
    only on the episodes table.
    paulijar committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    a609d5a View commit details
    Browse the repository at this point in the history

Commits on Aug 20, 2021

  1. Update changelog and a workaround for a Scrutinizer issue

    Scrutinizer doesn't know that object of type SimpleXMLElement may be
    evaluated as false, hence claim that the argument could be actually
    null.
    paulijar committed Aug 20, 2021
    Configuration menu
    Copy the full SHA
    df86c04 View commit details
    Browse the repository at this point in the history
  2. Ampache: Support podcasts on the method get_art

    The support was almost there, but enabling it for this content type had
    been forgotten previously.
    paulijar committed Aug 20, 2021
    Configuration menu
    Copy the full SHA
    aa174fe View commit details
    Browse the repository at this point in the history