mirror of
https://github.com/gmemstr/pogo.git
synced 2024-09-19 17:21:10 +01:00
Restructuring directory
This commit is contained in:
parent
f527effcdd
commit
6ddb659974
|
@ -1,6 +1,6 @@
|
|||
# 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
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
/* admin.go
|
||||
*
|
||||
* Here is where all the neccesary functions for managing episodes
|
||||
* live, e.g adding removing etc.
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
|
@ -7,6 +13,7 @@ import (
|
|||
"io/ioutil"
|
||||
"io"
|
||||
"os"
|
||||
"log"
|
||||
)
|
||||
|
||||
func CreateEpisode(w http.ResponseWriter, r *http.Request) {
|
||||
|
@ -42,4 +49,15 @@ func CreateEpisode(w http.ResponseWriter, r *http.Request) {
|
|||
defer f.Close()
|
||||
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