Skip to content

Commit

Permalink
Add settings and actions for AniDB notifications (#999)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshithmohan authored Aug 20, 2024
1 parent 44aa623 commit e890614
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Dialogs/ActionsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ const actions = {
data: [
'download-missing-anidb-data',
'sync-votes',
'sync-mylist',
'add-all-manually-linked-files-to-mylist',
'update-all-anidb-info',
'update-anidb-calendar',
'get-anidb-notifications',
'process-moved-files',
'sync-mylist',
],
},
trakt: {
Expand Down
10 changes: 10 additions & 0 deletions src/core/quick-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ const quickActions = {
functionName: 'UpdateAllAniDBInfo',
info: 'Update all Series information with the latest data from AniDB.',
},
'get-anidb-notifications': {
name: 'Get AniDB Notifications',
functionName: 'GetAniDBNotifications',
info: 'Fetch unread notifications and messages from AniDB',
},
'process-moved-files': {
name: 'Process Moved Files',
functionName: 'RefreshAniDBMovedFiles',
info: 'Process file moved messages from AniDB. This will force an update on the affected files.',
},
'sync-trakt': {
name: 'Sync Trakt Collection',
functionName: 'SyncTrakt',
Expand Down
2 changes: 2 additions & 0 deletions src/core/react-query/settings/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ export const initialSettings: SettingsType = {
MyList_UpdateFrequency: 1,
MyListStats_UpdateFrequency: 1,
File_UpdateFrequency: 1,
Notification_UpdateFrequency: 1,
Notification_HandleMovedFiles: false,
},
TvDB: {
AutoLink: false,
Expand Down
2 changes: 2 additions & 0 deletions src/core/types/api/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ export type SettingsAnidbUpdateType = {
MyList_UpdateFrequency: SettingsUpdateFrequencyType;
MyListStats_UpdateFrequency: SettingsUpdateFrequencyType;
File_UpdateFrequency: SettingsUpdateFrequencyType;
Notification_UpdateFrequency: SettingsUpdateFrequencyType;
Notification_HandleMovedFiles: boolean;
};

export type SettingsTvdbDownloadType = {
Expand Down
19 changes: 19 additions & 0 deletions src/pages/settings/tabs/AniDBSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ function AniDBSettings() {
MyList_StorageState,
MyList_UpdateFrequency,
MyListStats_UpdateFrequency,
Notification_HandleMovedFiles,
Notification_UpdateFrequency,
Password,
Username,
} = newSettings.AniDb;
Expand Down Expand Up @@ -308,6 +310,23 @@ function AniDBSettings() {
<UpdateFrequencyValues />
</SelectSmall>
</div>
<div className="flex items-center justify-between">
<span>Notifications</span>
<SelectSmall
id=" notifications"
value={Notification_UpdateFrequency}
onChange={event => updateSetting('AniDb', 'Notification_UpdateFrequency', event.target.value)}
>
<UpdateFrequencyValues />
</SelectSmall>
</div>
<Checkbox
justify
label="Handle Moved Files"
id="handle-moved-files"
isChecked={Notification_HandleMovedFiles}
onChange={event => updateSetting('AniDb', 'Notification_HandleMovedFiles', event.target.checked)}
/>
</div>
</div>
<div className="border-b border-panel-border" />
Expand Down

0 comments on commit e890614

Please sign in to comment.