mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
ExportData → ExchangeData
This commit is contained in:
parent
71670a065d
commit
fbc21da913
3 changed files with 6 additions and 6 deletions
|
@ -18,7 +18,7 @@ use crate::{
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
pub(super) struct ExportData {
|
pub(super) struct ExchangeData {
|
||||||
pub(super) decks: Vec<Deck>,
|
pub(super) decks: Vec<Deck>,
|
||||||
pub(super) notes: Vec<Note>,
|
pub(super) notes: Vec<Note>,
|
||||||
pub(super) cards: Vec<Card>,
|
pub(super) cards: Vec<Card>,
|
||||||
|
@ -28,7 +28,7 @@ pub(super) struct ExportData {
|
||||||
pub(super) media_paths: HashSet<PathBuf>,
|
pub(super) media_paths: HashSet<PathBuf>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ExportData {
|
impl ExchangeData {
|
||||||
pub(super) fn gather_data(
|
pub(super) fn gather_data(
|
||||||
&mut self,
|
&mut self,
|
||||||
col: &mut Collection,
|
col: &mut Collection,
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
// Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
use super::gather::ExportData;
|
use super::gather::ExchangeData;
|
||||||
use crate::{prelude::*, revlog::RevlogEntry};
|
use crate::{prelude::*, revlog::RevlogEntry};
|
||||||
|
|
||||||
impl Collection {
|
impl Collection {
|
||||||
pub(super) fn insert_data(&mut self, data: &ExportData) -> Result<()> {
|
pub(super) fn insert_data(&mut self, data: &ExchangeData) -> Result<()> {
|
||||||
self.insert_decks(&data.decks)?;
|
self.insert_decks(&data.decks)?;
|
||||||
self.insert_notes(&data.notes)?;
|
self.insert_notes(&data.notes)?;
|
||||||
self.insert_cards(&data.cards)?;
|
self.insert_cards(&data.cards)?;
|
||||||
|
|
|
@ -11,7 +11,7 @@ use tempfile::NamedTempFile;
|
||||||
use crate::{
|
use crate::{
|
||||||
collection::CollectionBuilder,
|
collection::CollectionBuilder,
|
||||||
import_export::{
|
import_export::{
|
||||||
gather::ExportData,
|
gather::ExchangeData,
|
||||||
package::{
|
package::{
|
||||||
colpkg::export::{export_collection, MediaIter},
|
colpkg::export::{export_collection, MediaIter},
|
||||||
Meta,
|
Meta,
|
||||||
|
@ -70,7 +70,7 @@ impl Collection {
|
||||||
with_scheduling: bool,
|
with_scheduling: bool,
|
||||||
with_media: bool,
|
with_media: bool,
|
||||||
) -> Result<HashSet<PathBuf>> {
|
) -> Result<HashSet<PathBuf>> {
|
||||||
let mut data = ExportData::default();
|
let mut data = ExchangeData::default();
|
||||||
data.gather_data(self, search, with_scheduling)?;
|
data.gather_data(self, search, with_scheduling)?;
|
||||||
if with_media {
|
if with_media {
|
||||||
data.gather_media_paths();
|
data.gather_media_paths();
|
||||||
|
|
Loading…
Reference in a new issue