diff --git a/htdocs/lib/BookmarkBar.js b/htdocs/lib/BookmarkBar.js index 6237e2e5..eda9a6a4 100644 --- a/htdocs/lib/BookmarkBar.js +++ b/htdocs/lib/BookmarkBar.js @@ -1,6 +1,6 @@ function BookmarkBar() { var me = this; - me.toScan = ['lsb', 'usb', 'usbd', 'cw', 'am', 'sam', 'nfm']; + me.modesToScan = ['lsb', 'usb', 'cw', 'am', 'sam', 'nfm']; me.localBookmarks = new BookmarkLocalStorage(); me.$container = $("#openwebrx-bookmarks-container"); me.bookmarks = {}; @@ -113,7 +113,7 @@ BookmarkBar.prototype.showEditDialog = function(bookmark) { name: "", frequency: center_freq + this.getDemodulator().get_offset_frequency(), modulation: mode, - scannable : this.toScan.indexOf(mode) >= 0 + scannable : this.modesToScan.indexOf(mode) >= 0 } } this.$dialog.bookmarkDialog().setValues(bookmark); diff --git a/htdocs/lib/Scanner.js b/htdocs/lib/Scanner.js index e6b5c0f2..2e9201cf 100644 --- a/htdocs/lib/Scanner.js +++ b/htdocs/lib/Scanner.js @@ -1,5 +1,5 @@ function Scanner(bookmarkBar, msec) { - this.modes = ['lsb', 'usb', 'usbd', 'cw', 'am', 'sam', 'nfm']; + this.modes = ['lsb', 'usb', 'cw', 'am', 'sam', 'nfm']; this.bbar = bookmarkBar; this.bookmarks = null; this.msec = msec; @@ -93,7 +93,7 @@ Scanner.prototype.start = function() { this.current = -1; // Get all scannable bookmarks from the bookmark bar this.bookmarks = this.bbar.getAllBookmarks().filter( - (b) => !!b.scannable && !!b.frequency && !!b.modulation && this.modes.indexOf(b.modulation)>=0 + (b) => !!b.scannable && !!b.frequency && !!b.modulation ); // If there are bookmarks to scan... diff --git a/owrx/bookmarks.py b/owrx/bookmarks.py index 80130e66..b7b3aeea 100644 --- a/owrx/bookmarks.py +++ b/owrx/bookmarks.py @@ -10,13 +10,19 @@ logger = logging.getLogger(__name__) class Bookmark(object): + SCANNABLE_MODES = ["lsb", "usb", "cw", "am", "sam", "nfm"] + def __init__(self, j, srcFile: str = None): self.name = j["name"] self.frequency = j["frequency"] self.modulation = j["modulation"] self.description = j["description"] if "description" in j else "" - self.scannable = j["scannable"] if "scannable" in j else True self.srcFile = srcFile + # By default, only scan modulations that make sense to scan + if "scannable" in j: + self.scannable = j["scannable"] + else: + self.scannable = j["modulation"] in Bookmark.SCANNABLE_MODES def getName(self): return self.name