Remove unused feature toggles

This commit is contained in:
Deluan 2020-06-11 22:11:59 -04:00
parent 0033966c25
commit c742ae0843
5 changed files with 8 additions and 18 deletions

View File

@ -36,15 +36,13 @@ type nd struct {
// DevFlags. These are used to enable/disable debugging and incomplete features
DevLogSourceLine bool `default:"false"`
DevAutoCreateAdminPassword string `default:""`
DevEnableUIPlaylists bool `default:"true"`
DevEnableUIStarred bool `default:"true"`
}
var Server = &nd{}
// TODO refactor configuration and use something different. Maybe https://github.com/spf13/cobra
// This function loads the config just load the ConfigFile. This is very cumbersome, but doesn't
// seem there's a simpler way to do thiswith multiconfig. Time to replace this library?
// This function loads the whole config just to get the ConfigFile. This is very cumbersome, but doesn't
// seem there's a simpler way to do this with multiconfig. Time to replace this library?
func configFile() string {
conf := &nd{}
loader := multiconfig.MultiLoader(

View File

@ -30,8 +30,6 @@ func ServeIndex(ds model.DataStore, fs http.FileSystem) http.HandlerFunc {
"baseURL": strings.TrimSuffix(conf.Server.BaseURL, "/"),
"loginBackgroundURL": conf.Server.UILoginBackgroundURL,
"enableTranscodingConfig": conf.Server.EnableTranscodingConfig,
"enablePlaylists": conf.Server.DevEnableUIPlaylists,
"enableStarred": conf.Server.DevEnableUIStarred,
}
j, err := json.Marshal(appConfig)
if err != nil {

View File

@ -14,7 +14,6 @@ import artist from './artist'
import playlist from './playlist'
import { Player, playQueueReducer } from './audioplayer'
import { albumViewReducer } from './album/albumState'
import config from './config'
import customRoutes from './routes'
import themeReducer from './personal/themeReducer'
import { addToPlaylistDialogReducer } from './dialogs/dialogState'
@ -50,13 +49,11 @@ const App = () => (
<Resource name="album" {...album} options={{ subMenu: 'library' }} />,
<Resource name="artist" {...artist} options={{ subMenu: 'library' }} />,
<Resource name="song" {...song} options={{ subMenu: 'library' }} />,
config.enablePlaylists && (
<Resource
name="playlist"
{...playlist}
options={{ subMenu: 'library' }}
/>
),
<Resource
name="playlist"
{...playlist}
options={{ subMenu: 'library' }}
/>,
permissions === 'admin' ? (
<Resource name="user" {...user} options={{ subMenu: 'settings' }} />
) : null,

View File

@ -8,7 +8,6 @@ import MoreVertIcon from '@material-ui/icons/MoreVert'
import StarIcon from '@material-ui/icons/Star'
import StarBorderIcon from '@material-ui/icons/StarBorder'
import { addTracks, setTrack } from '../audioplayer'
import config from '../config'
import { openAddToPlaylist } from '../dialogs/dialogState'
const useStyles = makeStyles({
@ -100,7 +99,7 @@ const SongContextMenu = ({
return (
<span className={classes.noWrap}>
{config.enableStarred && showStar && (
{showStar && (
<IconButton
onClick={handleToggleStar}
size={'small'}

View File

@ -7,8 +7,6 @@ const defaultConfig = {
baseURL: '',
loginBackgroundURL: 'https://source.unsplash.com/random/1600x900?music',
enableTranscodingConfig: true,
enablePlaylists: true,
enableStarred: true,
}
let config