mirror of
https://github.com/gmemstr/pogo.git
synced 2024-09-20 01:31:09 +01:00
Restructuring directory
This commit is contained in:
parent
f527effcdd
commit
6ddb659974
|
@ -1,6 +1,6 @@
|
||||||
# whiterabbit
|
# whiterabbit
|
||||||
|
|
||||||
![gitgalaxy](https://img.shields.io/badge/website-gitgalaxy.com-blue.svg) ![shield](https://img.shields.io/badge/live-podcast.gitgalaxy.com-green.svg) ![follow](https://img.shields.io/twitter/follow/gitgalaxy.svg?style=social&label=Follow)
|
[![gitgalaxy](https://img.shields.io/badge/website-gitgalaxy.com-blue.svg)](https://gitgalaxy.com) [![shield](https://img.shields.io/badge/live-podcast.gitgalaxy.com-green.svg)](https://podcast.gitgalaxy.com) [![follow](https://img.shields.io/twitter/follow/gitgalaxy.svg?style=social&label=Follow)](https://twitter.com/gitgalaxy)
|
||||||
|
|
||||||
|
|
||||||
podcast rss generator and cms in golang
|
podcast rss generator and cms in golang
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
/* admin.go
|
||||||
|
*
|
||||||
|
* Here is where all the neccesary functions for managing episodes
|
||||||
|
* live, e.g adding removing etc.
|
||||||
|
*/
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -7,6 +13,7 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
"log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func CreateEpisode(w http.ResponseWriter, r *http.Request) {
|
func CreateEpisode(w http.ResponseWriter, r *http.Request) {
|
||||||
|
@ -43,3 +50,14 @@ func CreateEpisode(w http.ResponseWriter, r *http.Request) {
|
||||||
io.Copy(f, file)
|
io.Copy(f, file)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func RemoveEpisode(episode string) {
|
||||||
|
// Episode should be the full MP3 filename
|
||||||
|
// Remove MP3 first
|
||||||
|
os.Remove(episode)
|
||||||
|
sn,err := strings.Replace(episode, ".mp3", "_SHOWNOTES.md", 2)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
os.Remove(sn)
|
||||||
|
}
|
Loading…
Reference in a new issue