Skip to content

Commit

Permalink
Migrate to tentacle namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Kara-Zor-El committed Apr 3, 2024
1 parent 7ea345e commit bc32124
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 21 deletions.
4 changes: 2 additions & 2 deletions lib/providers/fetchBooks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import 'package:dio/dio.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:openapi/openapi.dart';
import 'package:tentacle/tentacle.dart';
import 'package:built_collection/built_collection.dart';
import 'package:sentry_flutter/sentry_flutter.dart';

Expand Down Expand Up @@ -46,7 +46,7 @@ Future<void> getComics(String comicsId) async {
]);

// turn into built list
final api = Openapi(basePathOverride: url).getItemsApi();
final api = Tentacle(basePathOverride: url).getItemsApi();
Response<BaseItemDtoQueryResult>? response;
bool useSentry = prefs.getBool('useSentry') ?? false;
try {
Expand Down
4 changes: 2 additions & 2 deletions lib/providers/fetchCategories.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// The purpose of this file is to fetch the categories from the database

import 'package:shared_preferences/shared_preferences.dart';
import 'package:openapi/openapi.dart';
import 'package:tentacle/tentacle.dart';
import 'package:jellybook/providers/fetchBooks.dart';
import 'package:jellybook/providers/folderProvider.dart';
import 'package:jellybook/models/entry.dart';
Expand Down Expand Up @@ -50,7 +50,7 @@ Future<(List<Entry>, List<Folder>)> getServerCategories({
logger.d("got prefs");
Map<String, String> headers =
getHeaders(url, client, device, deviceId, version, token);
final api = Openapi(basePathOverride: url).getUserViewsApi();
final api = Tentacle(basePathOverride: url).getUserViewsApi();
var response;
try {
response = await api.getUserViews(
Expand Down
6 changes: 3 additions & 3 deletions lib/providers/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'package:package_info_plus/package_info_plus.dart' as package_info;
import 'package:isar/isar.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:jellybook/models/login.dart';
import 'package:openapi/openapi.dart';
import 'package:tentacle/tentacle.dart';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:jellybook/variables.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
Expand Down Expand Up @@ -95,12 +95,12 @@ class LoginProvider {
"URL is not valid. Please check the URL and try again.";
}

final api = Openapi(basePathOverride: _url);
final api = Tentacle(basePathOverride: _url);
final apiInstance = api.getUserApi();
Response<AuthenticationResult> response;

try {
// use the authenticateUserByNameRequest from openapi/lib/src/model/authenticate_user_by_name_request.g.dart
// use the authenticateUserByNameRequest from tentacle/lib/src/model/authenticate_user_by_name_request.g.dart
var authenticateUserByNameRequest = AuthenticateUserByNameRequest((b) => b
..username = username
..pw = password);
Expand Down
4 changes: 2 additions & 2 deletions lib/providers/updateLike.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import 'package:isar/isar.dart';
import 'package:jellybook/models/entry.dart';
import 'package:openapi/openapi.dart';
import 'package:tentacle/tentacle.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:package_info_plus/package_info_plus.dart' as p_info;
import 'package:jellybook/variables.dart';
Expand Down Expand Up @@ -38,7 +38,7 @@ Future<void> updateLike(String id) async {
'Host': server.substring(server.indexOf("//") + 2, server.length),
'Content-Length': '0',
};
final api = Openapi(basePathOverride: server).getUserLibraryApi();
final api = Tentacle(basePathOverride: server).getUserLibraryApi();
logger.d(url);
bool useSentry = prefs.getBool('useSentry') ?? false;
if (entries?.isFavorited == false) {
Expand Down
4 changes: 2 additions & 2 deletions lib/providers/updatePagenum.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// the purpose of this file is to update the page number of the current page on jellyfin
import 'package:openapi/openapi.dart';
import 'package:tentacle/tentacle.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:package_info_plus/package_info_plus.dart' as p_info;
import 'package:jellybook/variables.dart';
Expand Down Expand Up @@ -31,7 +31,7 @@ Future<void> updatePagenum(String id, int pagenum) async {
'Host': server.substring(server.indexOf("//") + 2, server.length),
'Content-Length': '0',
};
final api = Openapi(basePathOverride: server).getPlaystateApi();
final api = Tentacle(basePathOverride: server).getPlaystateApi();
try {
final response = await api.onPlaybackProgress(
userId: userId,
Expand Down
6 changes: 3 additions & 3 deletions lib/screens/EditScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import 'package:jellybook/models/entry.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:jellybook/variables.dart';
import 'package:package_info_plus/package_info_plus.dart' as p_info;
import 'package:openapi/openapi.dart';
import 'package:tentacle/tentacle.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:image_picker/image_picker.dart';
import 'package:built_collection/built_collection.dart';
Expand Down Expand Up @@ -185,7 +185,7 @@ class _EditScreenState extends State<EditScreen> {
'Origin': server,
'Host': server.substring(server.indexOf("//") + 2, server.length),
};
final api = Openapi(basePathOverride: server).getItemUpdateApi();
final api = Tentacle(basePathOverride: server).getItemUpdateApi();
DateTime? dateTime;
bool useSentry = prefs.getBool('useSentry') ?? false;
try {
Expand Down Expand Up @@ -245,7 +245,7 @@ class _EditScreenState extends State<EditScreen> {
);
}
if (imageChanged) {
final api2 = Openapi(basePathOverride: server).getImageApi();
final api2 = Tentacle(basePathOverride: server).getImageApi();
// get the image encoded in base64
File imagefile = File(entry.imagePath);
MultipartFile file = await MultipartFile.fromFile(
Expand Down
4 changes: 2 additions & 2 deletions lib/screens/MainScreens/settingsScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import 'package:jellybook/variables.dart';
import 'package:palette_generator/palette_generator.dart';
import 'package:sentry/sentry.dart';

import 'package:openapi/openapi.dart';
import 'package:tentacle/tentacle.dart';

class SettingsScreen extends StatefulWidget {
@override
Expand Down Expand Up @@ -309,7 +309,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
'Host': server.substring(server.indexOf("//") + 2, server.length),
'Content-Length': '0',
};
final api = Openapi(basePathOverride: server).getImageApi();
final api = Tentacle(basePathOverride: server).getImageApi();
Uint8List image = Uint8List(0);
ImageProvider imageProvider = Image.asset('assets/images/Logo.png').image;
try {
Expand Down
4 changes: 2 additions & 2 deletions lib/screens/downloaderScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import 'package:unrar_file/unrar_file.dart';
import 'package:jellybook/providers/fileNameFromTitle.dart';
import 'package:jellybook/providers/parseEpub.dart';
import 'package:jellybook/providers/ComicInfoXML.dart';
import 'package:openapi/openapi.dart';
import 'package:tentacle/tentacle.dart';

// import the database
import 'package:jellybook/models/entry.dart';
Expand Down Expand Up @@ -153,7 +153,7 @@ class _DownloadScreenState extends State<DownloadScreen> {
entry.filePath = dir;
logger.d('Directory created');
logger.d('Attempting to download file');
final api = Openapi(basePathOverride: entry.url).getLibraryApi();
final api = Tentacle(basePathOverride: entry.url).getLibraryApi();
Response<Uint8List> download;
downloading = true;
download = await api
Expand Down
4 changes: 2 additions & 2 deletions lib/screens/infoScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import 'package:jellybook/models/entry.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:jellybook/variables.dart';
import 'package:package_info_plus/package_info_plus.dart' as p_info;
import 'package:openapi/openapi.dart';
import 'package:tentacle/tentacle.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:jellybook/providers/Author.dart';

Expand Down Expand Up @@ -274,7 +274,7 @@ class _InfoScreenState extends State<InfoScreen> {
'Content-Length': '0',
};

final api = Openapi(basePathOverride: server).getPersonsApi();
final api = Tentacle(basePathOverride: server).getPersonsApi();
final person = await api.getPerson(name: author, headers: headers);
if (person.data!.imageTags == null || person.data!.imageTags!.isEmpty) {
return "asset";
Expand Down
8 changes: 8 additions & 0 deletions linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,28 @@
#include "generated_plugin_registrant.h"

#include <audioplayers_linux/audioplayers_linux_plugin.h>
#include <file_selector_linux/file_selector_plugin.h>
#include <flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h>
#include <isar_flutter_libs/isar_flutter_libs_plugin.h>
#include <sentry_flutter/sentry_flutter_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) audioplayers_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "AudioplayersLinuxPlugin");
audioplayers_linux_plugin_register_with_registrar(audioplayers_linux_registrar);
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin");
flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar);
g_autoptr(FlPluginRegistrar) isar_flutter_libs_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "IsarFlutterLibsPlugin");
isar_flutter_libs_plugin_register_with_registrar(isar_flutter_libs_registrar);
g_autoptr(FlPluginRegistrar) sentry_flutter_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "SentryFlutterPlugin");
sentry_flutter_plugin_register_with_registrar(sentry_flutter_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
Expand Down
2 changes: 2 additions & 0 deletions linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

list(APPEND FLUTTER_PLUGIN_LIST
audioplayers_linux
file_selector_linux
flutter_secure_storage_linux
isar_flutter_libs
sentry_flutter
url_launcher_linux
)

Expand Down
2 changes: 1 addition & 1 deletion submodules/tentacle
Submodule tentacle updated 734 files

0 comments on commit bc32124

Please sign in to comment.