mirror of
https://github.com/Xevion/glance.git
synced 2025-12-15 06:11:59 -06:00
Merge branch 'release/v0.6.0' into features
This commit is contained in:
@@ -38,16 +38,10 @@ func fetchLatestGithubRelease(request *ReleaseRequest) (*AppRelease, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
version := response.TagName
|
||||
|
||||
if len(version) > 0 && version[0] != 'v' {
|
||||
version = "v" + version
|
||||
}
|
||||
|
||||
return &AppRelease{
|
||||
Source: ReleaseSourceGithub,
|
||||
Name: request.Repository,
|
||||
Version: version,
|
||||
Version: normalizeVersionFormat(response.TagName),
|
||||
NotesUrl: response.HtmlUrl,
|
||||
TimeReleased: parseRFC3339Time(response.PublishedAt),
|
||||
Downvotes: response.Reactions.Downvotes,
|
||||
|
||||
@@ -38,16 +38,10 @@ func fetchLatestGitLabRelease(request *ReleaseRequest) (*AppRelease, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
version := response.TagName
|
||||
|
||||
if len(version) > 0 && version[0] != 'v' {
|
||||
version = "v" + version
|
||||
}
|
||||
|
||||
return &AppRelease{
|
||||
Source: ReleaseSourceGitlab,
|
||||
Name: request.Repository,
|
||||
Version: version,
|
||||
Version: normalizeVersionFormat(response.TagName),
|
||||
NotesUrl: response.Links.Self,
|
||||
TimeReleased: parseRFC3339Time(response.ReleasedAt),
|
||||
}, nil
|
||||
|
||||
@@ -105,3 +105,13 @@ func parseRFC3339Time(t string) time.Time {
|
||||
|
||||
return parsed
|
||||
}
|
||||
|
||||
func normalizeVersionFormat(version string) string {
|
||||
version = strings.ToLower(strings.TrimSpace(version))
|
||||
|
||||
if len(version) > 0 && version[0] != 'v' {
|
||||
return "v" + version
|
||||
}
|
||||
|
||||
return version
|
||||
}
|
||||
|
||||
@@ -11,10 +11,8 @@ import (
|
||||
|
||||
type youtubeFeedResponseXml struct {
|
||||
Channel string `xml:"author>name"`
|
||||
ChannelLink struct {
|
||||
Href string `xml:"href,attr"`
|
||||
} `xml:"link"`
|
||||
Videos []struct {
|
||||
ChannelLink string `xml:"author>uri"`
|
||||
Videos []struct {
|
||||
Title string `xml:"title"`
|
||||
Published string `xml:"published"`
|
||||
Link struct {
|
||||
@@ -97,7 +95,7 @@ func FetchYoutubeChannelUploads(channelIds []string, videoUrlTemplate string, in
|
||||
Title: video.Title,
|
||||
Url: videoUrl,
|
||||
Author: response.Channel,
|
||||
AuthorUrl: response.ChannelLink.Href + "/videos",
|
||||
AuthorUrl: response.ChannelLink + "/videos",
|
||||
TimePosted: parseYoutubeFeedTime(video.Published),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user