nextcloud app that replicates basic gpodder.net api

Overview

nextcloud-gpodder

Nextcloud app that replicates basic gpodder.net api

This app serves as synchronization endpoint for AntennaPod: https://github.com/AntennaPod/AntennaPod/pull/5243/
This feature will be available in AntennaPod as of version 2.5.0, which will be released towards the end of 2021.

API

subscription

  • get subscription changes: GET /index.php/apps/gpoddersync/subscriptions
    • (optional) GET parameter since (UNIX time)
  • upload subscription changes : POST /index.php/apps/gpoddersync/subscription_change/create
    • returns nothing

The API replicates this: https://gpoddernet.readthedocs.io/en/latest/api/reference/subscriptions.html

episode action

  • get episode actions: GET /index.php/apps/gpoddersync/episode_action
    • (optional) GET parameter since (UNIX time)
    • fields: podcast, episode, guid, action, timestamp, position, started, total
  • create episode actions: POST /index.php/apps/gpoddersync/episode_action/create
    • fields: podcast, episode, guid, action, timestamp, position, started, total
    • position, started and total are optional, default value is -1
    • returns JSON with current timestamp

The API replicates this: https://gpoddernet.readthedocs.io/en/latest/api/reference/events.html

we also process the property guid

Example requests:

GET /index.php/apps/gpoddersync/episode_action?since=1633240761

{
    "actions": [
      {
       "podcast": "http://example.com/feed.rss",
       "episode": "http://example.com/files/s01e20.mp3",
       "guid": "s01e20-example-org",
       "action": "PLAY",
       "timestamp": "2009-12-12T09:00:00",
       "started": 15,
       "position": 120,
       "total":  500
      },
      {
       "podcast": "http://example.com/feed.rss",
       "episode": "http://example.com/files/s01e20.mp3",
       "guid": "s01e20-example-org",
       "action": "DOWNLOAD",
       "timestamp": "2009-12-12T09:00:00",
       "started": -1,
       "position": -1,
       "total":  -1
      },
    ],
    "timestamp": 12345
}
POST /index.php/apps/gpoddersync/episode_action/create

[
  {
   "podcast": "http://example.com/feed.rss",
   "episode": "http://example.com/files/s01e20.mp3",
   "guid": "s01e20-example-org",
   "action": "play",
   "timestamp": "2009-12-12T09:00:00",
   "started": 15,
   "position": 120,
   "total":  500
  },
  {
   "podcast": "http://example.org/podcast.php",
   "episode": "http://ftp.example.org/foo.ogg",
   "guid": "foo-bar-123",
   "action": "DOWNLOAD",
   "timestamp": "2009-12-12T09:05:21",
  }
]
Comments
  • Specified key was too long; max key length is 3072 bytes

    Specified key was too long; max key length is 3072 bytes

    Updating comes with this error:

    Database error when running migration 0006Date20221106215500 for app gpoddersync An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 3072 bytes

    Deleting from apps and trying to reinstall I have the same problem.

    Using docker linuxserver nextcloud.

    opened by kronna 21
  • Added view of synced subs in personal settings

    Added view of synced subs in personal settings

    • PHP changes:

      • New endpoints:
        • GET apps/gpoddersync/personal_settings/metrics
        • GET apps/gpoddersync/personal_settings/podcast_data
      • New controller: lib/Controller/PersonalSettingsController.php
      • New types in lib/Core/PodcastData
      • Added personal settings page to appinfo/info.xml that points to lib/Settings/GPodderSyncPersonal.php, that in turn just points to the Vue view.
    • Added Vue! I've basically no idea what I'm doing, but I took a lot of inspiration from:

      • https://docs.nextcloud.com/server/latest/developer_manual/app_development/tutorial.html
      • https://github.com/nextcloud/app-tutorial
      • I only used existing components from https://nextcloud-vue-components.netlify.app/ so it's really basic. But it'll do for a first iteration I think :)
    • CI/CD:

      • Updated release GitHub action to also build JavaScript code
      • Added GitHub Action for building JavaScript code on all pull requests

    Closes #88

    Screenshots

    2022-07-17_20-34 2022-07-17_20-30

    Disclaimer

    I've not used PHP in so many years, and this is my first time with Vue.

    Therefore, please go ahead and roast my code as much as you can :fire: I can take it, and more importantly I want to learn what others want to focus on to keep their PHP and Vue code clean and maintainable.

    opened by jilleJr 20
  • Enable Episode upload as array

    Enable Episode upload as array

    This enables gpoddersync to work with EpisodeActions from an multidimensional array as wished here. SInce it is described in the gpodder api docs this way, this would be preferrable. This would make it easier for other podcast apps to implement gpoddersync as sync service as well.

    With this, gpoddersync checks whether the data is an array or a string and parses it with the according functions. In order to maintain the logic, the array has to come in the format given at the bottom, 3-dimensional. The "data"-dimension could fall away, but then the Controller had to be rewritten drastically.

    So it's discussable if the current variant is preferrable or a version where an input without this 3rd dimension. The last variant would be even closer to the gpodder api.

    I also wrote two tests, for an input without guid and an input of multiple EpisodeActions - and phpunit doesn't complain.


    Format example:

    {"data": [
     {
      "podcast": "https://www.ndr.de/nachrichten/info/podcast4684.xml", 
      "episode": "https://mediandr-a.akamaihd.net/download/podcasts/podcast4684/AU-20210914-1706-2200.mp31", 
      "guid": "AU-20210914-1706-2200-A1", 
      "action": "PLAY", 
      "timestamp": "Sun Oct 03 14:03:17 GMT+02:00 2021", 
      "started": 5600, 
      "position": 5600, 
      "total": 5600
     },
     {
      "podcast": "https://www.ndr.de/nachrichten/info/podcast4684.xml", 
      "episode": "https://mediandr-a.akamaihd.net/download/podcasts/podcast4684/AU-20210914-1706-2201.mp31", 
      "guid": "AU-20210914-1706-2201-A1", 
      "action": "PLAY", 
      "timestamp": "Sun Oct 03 14:03:17 GMT+02:00 2021", 
      "started": 5600, 
      "position": 5600, 
      "total": 5600
     }
    ]}
    
    opened by JonOfUs 15
  • Use EpisodeAction.guid as identifier if available

    Use EpisodeAction.guid as identifier if available

    EpisodeActions get a new field named "guid" which serves as identifier. This PR adds the ability to deal with EpisodeActions with and without guid

    AntennaPod currently does not provide the guid. Please use the following commit https://github.com/thrillfall/AntennaPod/commit/30e074f6db051367e1fcd91e0a979e6ea8609ede to make AntennaPod provid the guid

    opened by thrillfall 12
  • Update 3.3.0 to 3.4.0 impossible

    Update 3.3.0 to 3.4.0 impossible

    Hi, First, thanks for this wonderfull app !

    My nextcloud is 24.0.1 under Debian 11. Impossible to update GPodder from 3.3.0 to 3.4.0. Update is visible in App menu with update button ... I click on it and update message disappear as it was updatted but no ... it appears again soon after ! Any help welcome ;o) Cr9c

    opened by cr9christi9n 10
  • installing Gpoddersync ?

    installing Gpoddersync ?

    Hi, I'm under Nextcloud 23.0.2 I don't find Gpoddersync through Nextcloud/applications and I don't know how to install it with file downloaded from https://apps.nextcloud.com/apps/gpoddersync ?! I need help... thanks in avance. Cr9c

    opened by cr9christi9n 8
  • Enable processing of multiple EpisodeActions

    Enable processing of multiple EpisodeActions

    I tried parsing the EpisodeAction string with strpos and substr because I thought this would be a bit more robust than explode(), but you have to say what you think of it.

    I didn't get the test cases to work, probably because I don't understand phpunit, so maybe you could run the new test as well as the new testCreateFromString().

    This does not solve the problem that, if multiple episode changes did occur, only the latest one will be synchronized because AntennaPod seems to only send a single EpisodeAction at every sync. Nevertheless, I tested this new feature with curl POST requests and it worked flawlessly.

    opened by JonOfUs 7
  • Syncing kasts results in all episodes being marked as played

    Syncing kasts results in all episodes being marked as played

    I'm syncing AntennaPod nicely. I tried kasts and entered my credentials. After initial sync, all episoded are marked as played, so play stated do not get synced correctly!?

    https://bugs.kde.org/show_bug.cgi?id=454553

    opened by Uatschitchun 6
  • Store epoch to correct entry, fix uninitialized variable

    Store epoch to correct entry, fix uninitialized variable

    Found a bug in the migration: the UPDATE SQL query updates all entries where timestamp_epoch is 0. On my setup (sqlite) this lead to identical timestamp_epoch values in each updated entry. Selecting the entries by their id's fixes this.

    Additionally, this fixes #39 by initializing $result.

    opened by JonOfUs 6
  • Ensureproperties

    Ensureproperties

    This PR adds a check for required properties in the EpisodeActionReader just in case the app receives any malformed data.

    It also tries to do a bit of "housekeeping" and clean up some stuff:

    • remove unused imports/namespaces
    • add type hints and straighten out doc blocks where applicable
    • add additional unit tests (I will add more later if time permits)
    • set integer types in EpisodeActionEntity (see)
    • correctly call static methods in SubscriptionChangeRequestParser
    • improve exception handling in EpisodeActionSaver -> if update fails, do nothing and continue for now
    • remove unused method EpisodeActionWriter::purge()

    This might be a lot of changes for one PR, but it should not alter any behaviour besides ignoring requests with malformed data.

    Let me know what you think :)

    opened by mattsches 6
  • Potential issue with full synchronization 'since' timestamp

    Potential issue with full synchronization 'since' timestamp

    On full synchronization, since timestamp is set to 0 and so only episode and subscription changes from within the last week will be synchronized.

    Expected Behavior

    Full synchronization after first synchronization

    Current Behavior

    Only episode actions and subscriptions from within last week will be synchronized

    Possible Solution

    If not intended, repair since-parameter or correct createDateTimeFromTimestamp to be able to deal with since=0

    Steps to Reproduce

    1. Install AntennaPod debug with current build 3edd01e (12-08-2021) & Install gpoddersync 1.0.9.
    2. Do some subscription changes and create some episode actions
    3. Wait >1 week
    4. Delete app data, re-synchronize everything

    Context (Environment)

    Using MariaDB 10.3, php8.0, Nextcloud 22, gpoddersync 1.0.9, Raspberry Pi OS 64bit, nginx 1.14.2

    Detailed Description

    I recognized that after deleting AntennaPod app data and re-synchronizing subscriptions and episode changes, some episode changes won't synchronize. After some digging I found out that the full synchronization feature calls /subscription_change/list with since=0 and therefore createDateTimeFromTimestamp will always return a timestamp from a week ago (because 0 is false).

    The problem with this is that episode changes and subscriptions that are older than one week won't get synchronized.

    Is this behaviour intended?

    https://github.com/thrillfall/nextcloud-gpodder/blob/a87c010c7748c9ff5f654a9b74f33af419bd8e27/lib/Controller/EpisodeActionController.php#L95-L104

    If not intended, I could PR a fix, already found one.

    opened by JonOfUs 6
  • After syncing from gpodder to kde kasts all episodes are marked played

    After syncing from gpodder to kde kasts all episodes are marked played

    I'm sorry if I'm wrong with the terminology, as English is not my first language.

    I use nextcloud-gpodder for syncing my podcasts between Antennapod and KDE Kasts (which I run on my Ubuntu). All of the syncing works fine and out of the box. Exept only the "currently" playing episode gets synced into the Quenue. The other episodes does not appear there.

    I'm not sure if this is either a bug and therefore an issue here or if I'm doing a feature request right now.

    Thanks a lot for this great piece of software btw!

    EDIT:

    Taking a further look inside KDE Kasts I can see, that all episodes except the currently playing one are marked played. Luckily I've seen it bevore it got synced back to AntennaPod.

    System:

    Nextcloud Hub 3 (25.0.0)

    KDE Kasts 22.09 on Ubuntu 20.04.3 LTS installed via flathub

    AntennaPod installed from Google AppStore on Pixel 6a (Android 13)

    EDIT 2:

    A quick look into Nextcloud shows, that the showed playing time of the podcasts matches the actual listening time. I'm not entirely sure, if the problem occurs at the syncinc instance or if KDE Kasts messes things up.

    opened by moritztw 1
Releases(3.7.1)
🗨️ Nextcloud Talk – chat, video & audio calls for Nextcloud

Nextcloud Talk A video & audio conferencing app for Nextcloud Why is this so awesome? ?? Chat Nextcloud Talk comes with a simple text chat, allowing y

Nextcloud 1.3k Dec 23, 2022
This is Fully Working Net Banking Project Developed in PHP, HTML, JavaScript, CSS

Net Banking Project in PHP In this project i have develop real world net-banking project. This project is a best simulator for banking learners Featur

null 0 Feb 19, 2022
A simple Lumen web app to send basic commands and fetch the current status to your Ford vehicle with Sync 3 enabled

FordPass Access This is a simple Lumen web app to send basic commands and fetch the current status to your Ford vehicle with Sync 3 enabled. Local dev

Sam 4 Nov 21, 2022
Satu platform demo ringkas untuk rujukan Basic PHP

praktisphpmysql Satu platform demo ringkas untuk rujukan Basic PHP Demo https://legoom.biz.my/praktisphpmysql/ Belajar Koding Kemasukan Mei dan Septem

RB 11 Jun 21, 2022
Example basic bookmarking site, now in Laravel 4.

Bookymark An example Laravel 4 project. PSR-2 - all models and controllers are autoloaded from app/src. All code passes phpcs for PSR-2. Full PHPUnit

Mike Funk 17 Dec 19, 2022
Learning Management System made in vanilla PHP to learn core concepts and usage of some basic utils

Learning Management System Learning Management System made in vanilla PHP to learn core concepts and usage of some basic utils. Report Bug · Request F

TitansLab 1 Mar 30, 2022
Retrieve MySejahtera App's data from MySejahtera API and show to users via web browser. Written in PHP

MySejahtera-PHP-Web Retrieve MySejahtera App's data from MySejahtera API and show to users via web browser. Written in PHP. Disclaimer This web app is

Sam Sam 3 Oct 21, 2022
¡BACKEND OVER APP! API REST IMPLEMENTANDO CONCEPTOS DE ARQUITECTURA HEXAGONAL, DDD, TDD Y SOLID. HECHO EN LARAVEL & PHP

¡BACKEND OVER APP! API REST IMPLEMENTANDO CONCEPTOS DE ARQUITECTURA HEXAGONAL, DDD, TDD Y SOLID. HECHO EN LARAVEL & PHP

Cristian Camilo Vasquez 17 Dec 27, 2022
PHP backend Scripts to add and Manage Live tv Streaming android app

PHP Backend to Manage Live TV Streaming Android app Follow Given Steps to Setup Local Environment to run this php Script Setting Up Local Environment

Bikash Thapa 11 May 10, 2022
Crater is an open-source web & mobile app that helps you track expenses, payments & create professional invoices & estimates.

Introduction Crater is an open-source web & mobile app that helps you track expenses, payments & create professional invoices & estimates. Web Applica

Bytefury 6.7k Jan 1, 2023
Web based fantasy sports draft app

Hoot Draft makes running drafts for fantasy sports a real hoot! (dad jokes sold separately) Large color-coded draft board updates live during the draf

Matthew Orres 37 Sep 16, 2022
An open source self hosted notes and bookmarks taking web app.

Benotes An open source self hosted web app for your notes and bookmarks side by side. This project is currently in Beta. You may encounter bugs or err

null 264 Jan 2, 2023
This web app aims to manage alumnus databases.

Aplikasi Database Alumni Aplikasi berbasis web ini bertujuan untuk melakukan pendataan alumni. Aplikasi ini dibuat menggunakan framework CodeIgniter d

Ardi Cahyono 1 Nov 24, 2021
Official backend for VideoStream Android app.

About VideoStream Backend Official backend for VideoStream Android app, which is the CMS for VideoStream Android app. This backend is public for testi

Jesse Keskelä 1 Jan 30, 2022
Simple RESTful Web App to find Real Estate Listings

Unreal Estate is a simple RESTful web app that allows the user to find Real Estate listings they might be interested in. Unreal Estate is built on Laravel 5 and PHP 7.

Jett Durham 0 Jun 12, 2019
Scrumwala: Your very own Scrum, Agile project management web app - built with Laravel

Scrumwala Your very own Scrum/Agile web app built with Laravel Features Create and manage projects with plan and work views Group issues in a project

null 255 Nov 2, 2022
Japanese Cloze App

Requirements Docker Docker Compose Setup Clone the repository. Start the containers by running docker-compose up -d in the project root. Install the c

swkidd 1 Oct 28, 2021
This app aims to benchmark several video/live streaming OTT platforms

video-platform-bench This app aims to benchmark several video/live streaming OTT platforms based on Encoding Time performance and provide also a "Time

api.video 9 Dec 17, 2021
Laravel web app for signing up for community service opportunities

Community Service A Laravel web app for registering for service opportunities. Installation Make sure the following are installed on your system: Node

North Point Ministries 0 Mar 6, 2019