Skip to content

Conversation

@Soopyboo32
Copy link
Contributor

@Soopyboo32 Soopyboo32 commented Jan 4, 2025


db.transaction(tx => {
tx.executeSql(createRepositoryTableQuery);
tx.executeSql(addHiddenColumnQuery);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Db migration

Comment on lines +31 to +33
const chaptersToHide = existingChapters.filter(
c => !chapters.some(ch => ch.path === c.path),
);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hide chapters if they are known but not in the list given

SUM(unread) as chaptersUnread, SUM(isDownloaded) as chaptersDownloaded,
novelId, MAX(readTime) as lastReadAt, MAX(updatedTime) as lastUpdatedAt
FROM Chapter
WHERE hidden = 0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont show hidden chapters for unread counts

JOIN Novel
ON Chapter.novelId = Novel.id
WHERE Chapter.unread = 0 AND Novel.inLibrary = 1
WHERE Chapter.unread = 0 AND Novel.inLibrary = 1 AND Chapter.hidden = 0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont show hidden chapters for stats

name: _plg.name,
version: _plg.version,
hasUpdate: false,
hasSettings: !!_plg.pluginSettings,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update the hasSettings value on plugin update, not only plugin installation

): Promise<Response> => {
init = makeInit(init);
return await fetch(url, init);
return await fetch(url, init).then(checkCloudflareError);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

standardized cloudflare error handling across all plugins

Comment on lines +151 to +153
const unloadPlugin = (pluginId: string) => {
plugins[pluginId] = undefined;
};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

option to unload plugin so you dont need to restart app to apply plugin settings

interface PluginSetting {
value: string;
label: string;
type?: 'Switch';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add switch setting type

Object.entries(formValues).forEach(([key, value]) => {
storage.set(key, value);
});
unloadPlugin(pluginId);
Copy link
Contributor Author

@Soopyboo32 Soopyboo32 Jan 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unload plugin on settings change (itll get re-loaded when needed) as this allows re-initialization of plugin settings without app restart

Comment on lines +120 to +128
setting?.type === 'Switch' ? (
<SwitchItem
key={key}
label={setting.label}
value={!!formValues[key]}
onPress={() => handleChange(key, formValues[key] ? '' : 'true')}
theme={theme}
/>
) : (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switch setting type

(saves the values as either an empty string or the string "true" as plugin settings are all strings, and by making false falsy it will work just as well)

novelSettings: {
sort = defaultChapterSort,
filter = '',
filter = 'AND hidden=0',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by default hide hidden chapters

icon="filter-variant"
iconColor={filter ? filterColor(theme.isDark) : theme.onSurface}
iconColor={
filter.trim() !== 'AND hidden=0'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cus AND hidden=0 is default check for not eq that

Comment on lines +95 to +104
<Checkbox
theme={theme}
label={getString('novelScreen.bottomSheet.filters.dontExist')}
status={!filter.match('AND hidden=0')}
onPress={() => {
filter.match('AND hidden=0')
? filterChapters(filter.replace(/ ?AND hidden=0/, ''))
: filterChapters(filter + ' AND hidden=0');
}}
/>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checkbox to remove the AND hidden=0 check (to show hidden chapters)


return (
<BottomSheet snapPoints={[240]} bottomSheetRef={bottomSheetRef}>
<BottomSheet snapPoints={[280]} bottomSheetRef={bottomSheetRef}>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sheet needs to be taller cus new option

Comment on lines 90 to 92
const chaptersToHide = existingChapters.filter(
c => !chapters.some(ch => ch.path === c.path),
);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another place where hiding chapters that are in db but not in response

"settings": {
"title": "Plugin Settings",
"description": "Fill in the plugin settings. Restart app to apply the settings."
"description": "Fill in the plugin settings."
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You dont need to restart the app anymore 🔥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant