Skip to content

Commit

Permalink
Merge pull request #124 from sunshineplan/cache-patch
Browse files Browse the repository at this point in the history
Update cache package
  • Loading branch information
sunshineplan authored Jun 11, 2024
2 parents b98f301 + b954ee8 commit 47e5a24
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/sunshineplan/chrome v1.1.14
github.com/sunshineplan/gohttp v1.0.10
github.com/sunshineplan/useragent v1.0.1
github.com/sunshineplan/utils v0.1.66
github.com/sunshineplan/utils v0.1.67
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ github.com/sunshineplan/gohttp v1.0.10 h1:yXV1Jc+kRLsS0gOr2kKs2jywhso+X422xzV+uO
github.com/sunshineplan/gohttp v1.0.10/go.mod h1:aTmCdd7sOiBHDyFVDW9pTvX5ecRUOFym4zGN9DhwM18=
github.com/sunshineplan/useragent v1.0.1 h1:0x4MIlcOQ2awc1XKUwEJr+fDcJXpm/bw1H7Hbi79PbY=
github.com/sunshineplan/useragent v1.0.1/go.mod h1:u+8L7UYZqQI4iMgbMdhE1GldRohbrlQGZr5lzegPRLE=
github.com/sunshineplan/utils v0.1.66 h1:YwIuVQxmaL0bEnEKHU64pseCC18w2MZVtyrmY4VFOew=
github.com/sunshineplan/utils v0.1.66/go.mod h1:QMe2vCEFq9VliPac8WfXndi5jP0ZrPHus8wvJlgBy5M=
github.com/sunshineplan/utils v0.1.67 h1:YdeMbTryVv//6yka6qtNdgQqOifWVzR4kbCtw7v+imY=
github.com/sunshineplan/utils v0.1.67/go.mod h1:QMe2vCEFq9VliPac8WfXndi5jP0ZrPHus8wvJlgBy5M=
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down
5 changes: 2 additions & 3 deletions m3u8.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/sunshineplan/utils/cache"
)

var c = cache.New(false)
var c = cache.New[string, []byte](false)

func parse(url *url.URL, playlist m3u8.Playlist) (*url.URL, *m3u8.MediaPlaylist, error) {
switch playlist := playlist.(type) {
Expand Down Expand Up @@ -118,9 +118,8 @@ func read(s *m3u8.MediaSegment, file string) ([]byte, error) {
}

func getKey(url string) (b []byte, err error) {
value, ok := c.Get(url)
b, ok := c.Get(url)
if ok {
b = value.([]byte)
return
}

Expand Down

0 comments on commit 47e5a24

Please sign in to comment.