summaryrefslogtreecommitdiffci
path: root/internal/blog/b2.go
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
Diffstat (limited to 'internal/blog/b2.go')
-rw-r--r--internal/blog/b2.go21
1 files changed, 1 insertions, 20 deletions
diff --git a/internal/blog/b2.go b/internal/blog/b2.go
index f2ac890..8a4d363 100644
--- a/internal/blog/b2.go
+++ b/internal/blog/b2.go
@@ -2,7 +2,6 @@ package blog
import (
"context"
- "encoding/json"
"fmt"
"slices"
"strings"
@@ -38,20 +37,6 @@ func NewB2Client(cfg *config.StorageConfig) (Client, error) {
return &B2Client{b2cl: b2cl, bucket: bucket, prefix: b2cfg.Prefix}, nil
}
-func (c *B2Client) GetMedleys() ([]MedleyEntry, error) {
- idxRaw, err := c.readAll(MedleysIndexFileName)
- if err != nil {
- return nil, fmt.Errorf("read %s: %w", MedleysIndexFileName, err)
- }
-
- var idx []MedleyEntry
- if err := json.Unmarshal(idxRaw, &idx); err != nil {
- return nil, fmt.Errorf("unmarshal %s: %w", MedleysIndexFileName, err)
- }
-
- return idx, nil
-}
-
func (c *B2Client) Scan(prefix string) ([]*Page, error) {
filePaths := []*Page{}
@@ -117,11 +102,7 @@ func (c *B2Client) Scan(prefix string) ([]*Page, error) {
}
func (c *B2Client) ReadAll(path string) ([]byte, error) {
- return c.readAll(c.prefix + path)
-}
-
-func (c *B2Client) readAll(path string) ([]byte, error) {
- obj := c.bucket.Object(path)
+ obj := c.bucket.Object(c.prefix + path)
if obj == nil {
return nil, fmt.Errorf("failed to reference object in B2 bucket")
}