fix issues #54 and #55

swagger
Akhil Gupta 4 years ago
parent e437032421
commit ea3a8e090d

@ -30,17 +30,44 @@
var more = document.createElement("a");
more.textContent = " show more";
more.style.cursor = "pointer";
more.classList.add("link-show-more")
more.onclick = function () {
element.style.display = display;
newElement.style.display = "none";
var short= this.parentNode;
var sibling= short.parentNode.firstChild;
var long;
while (sibling) {
if(sibling.classList && sibling.classList.contains('long-version')){
long=sibling;
break;
}
sibling = sibling.nextSibling;
}
long.style.display = display;
short.style.display = "none";
};
var less = document.createElement("a");
less.textContent = " show less";
less.style.cursor = "pointer";
less.classList.add("link-show-less")
less.onclick = function () {
element.style.display = "none";
newElement.style.display = display;
var long= this.parentNode;
var sibling= long.parentNode.firstChild;
var short;
while (sibling) {
if(sibling.classList && sibling.classList.contains('short-version')){
short=sibling;
break;
}
sibling = sibling.nextSibling;
}
short.style.display = display;
long.style.display = "none";
};
newElement.appendChild(more);

@ -12,8 +12,20 @@ type OpmlModel struct {
Head OpmlHead `xml:"head"`
Body OpmlBody `xml:"body"`
}
type OpmlExportModel struct {
XMLName xml.Name `xml:"opml"`
Text string `xml:",chardata"`
Version string `xml:"version,attr"`
Head OpmlExportHead `xml:"head"`
Body OpmlBody `xml:"body"`
}
type OpmlHead struct {
Text string `xml:",chardata"`
Title string `xml:"title"`
//DateCreated time.Time `xml:"dateCreated"`
}
type OpmlExportHead struct {
Text string `xml:",chardata"`
Title string `xml:"title"`
DateCreated time.Time `xml:"dateCreated"`

@ -85,6 +85,7 @@ func GetAllPodcasts(sorting string) *[]db.Podcast {
func AddOpml(content string) error {
model, err := ParseOpml(content)
if err != nil {
fmt.Println(err.Error())
return errors.New("Invalid file format")
}
var wg sync.WaitGroup
@ -127,8 +128,8 @@ func ExportOmpl() ([]byte, error) {
outlines = append(outlines, toAdd)
}
toExport := model.OpmlModel{
Head: model.OpmlHead{
toExport := model.OpmlExportModel{
Head: model.OpmlExportHead{
Title: "Podgrab Feed Export",
DateCreated: time.Now(),
},

Loading…
Cancel
Save