Feature to Enable/Disable, Add, Edit and Delete RSS Filters

Aperta
#133 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

  • #134 di @buildwithmalik — chiusa senza merge

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
dart, flutter
Ambito
api, frontend, mobile

Direzione di ricerca

Inizia individuando il modello RSSFilter e i punti di ingresso dell'API usando api.rssPluginUrl, quindi esamina la funzione setRSSFilter proposta e la relativa richiesta form-encoded. Il lavoro è completato quando l'applicazione può abilitare, disabilitare, aggiungere, modificare ed eliminare i filtri RSS mantenendo tutti i filtri esistenti; l'issue fa riferimento a PR #134 per la funzionalità completa e funzionante.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement Todo

Current State

In the current state of the application, when the RSS Filter is either enabled or disabled, a message prompting the user to use the ruTorrent web interface to make the changes pops up as shown below.

RSS Filter Enable Disable

Furthermore, the option of adding, deleting or editing (existing) RSS Filters is not present.

Proposed Changes

  1. I would like to implement the feature of enabling and disabling the RSS Filters from the application itself.
  2. I would also like to implement an RSS Filter Edit Screen whose purpose will be to take user-input related to the RSS Filter (name, pattern, labels etc. )

Implementation

Enabling and Disabling RSS Filters

I will be using the RSS Plugin of the ruTorrent Web Interface to implement this feature. Implementing this feature would require changing the enabled integer in the RSS Filter object and making a POST request to the RSS plugin with the JSON form of the RSS Filter object (more on this below).

Add, Edit, Delete RSS Filters

Again the RSS Plugin will be used. A small catch here is, anytime any change is made to any of the filters, ALL (existing) filters have to be sent via the POST network call to the Plugin. If we attempt to send only the filter that has been changed, all other filters are deleted.

Now the issue with this approach is, a JSON object cannot contain two same keys for obvious reasons and the plugin was not accepting different JSON objects for different filters.

So we will use Content-Type: application/x-www-form-urlencoded to send the data after encoding all the existing RSS Filters in the application.

The one function that will implement both network implementations is given below.

/// Sets details of RSS Filters
  static setRSSFilter(Api api, List<RSSFilter> filters) async {

    // Set Headers
    Map<String, String> headers = {
      "Content-Type": "application/x-www-form-urlencoded"
    };
    headers.addAll(api.getAuthHeader());

    // Set mode of Query
    String queryString = "mode=setfilters&";

    // Encode and add all Filters to the query
    for (RSSFilter filter in filters ?? []) {
      queryString += Uri(queryParameters: filter.toJson()).query + "&";
    }

    // Execute the Network Call
    await api.ioClient
        .post(Uri.parse(api.rssPluginUrl), headers: headers, body: queryString);
  }

The video of the complete working of the proposed feature will be added in the feature PR.

PR #134

Lingua principale
Dart
Stelle
131
Fork
113
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di CCExtractor/rutorrent-flutter

Tutte le issue di CCExtractor/rutorrent-flutter

Issue simili

Altre issue su Dart

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.