Added Settings for Manga ordering, fixed theme selector

This commit is contained in:
Pablu23
2024-04-03 13:13:08 +02:00
parent f712211194
commit cb592c7109
4 changed files with 33 additions and 38 deletions

View File

@@ -13,16 +13,6 @@ const (
Updated
)
//type Table[K comparable, T any] interface {
// Get(key K) (T, bool)
// Set(key K, new T)
// All() []T
// Delete(key K) error
// Save(db *sql.DB) error
// Load(db *sql.DB) error
// Connect(key K, value *any) bool
//}
type DbTable[K comparable, T any] struct {
mutex sync.Mutex
items map[K]T
@@ -56,14 +46,6 @@ func (d *DbTable[K, T]) Get(key K) (T, bool) {
return val, ok
}
// GetRef unsafe
func (d *DbTable[K, T]) getRef(key K) (*T, bool) {
d.mutex.Lock()
defer d.mutex.Unlock()
val, ok := d.items[key]
return &val, ok
}
func (d *DbTable[K, T]) Set(key K, new T) {
d.mutex.Lock()
defer d.mutex.Unlock()